I have been masturbating for two whole years. I have had thoughts about other guys that I think are cute, and every time I think about them, I just want to masturbate. Is there a way for me to stop? I see him every day because I hang out with some of my friends who are kind of friends with him. Should I stay away from them? I have tried doing an Internet course that kind of helped me progress, and I haven't been going to church because I just don't feel like it will get any better. The pastor didn't really help, so I left. Ever since then, I have been staying at home, which makes me more vulnerable to sin. So how can I resist the urge to masturbate when I am alone?
"These things indeed have an appearance of wisdom in self-imposed religion, false humility, and neglect of the body, but are of no value against the indulgence of the flesh" (Colossians 2:23).
People have a bad tendency to "fix" problems the wrong way and then are surprised that the fix doesn't work.
Let's start with a basic fact. It is sinful for a guy to have sex with a guy. "Likewise also the men, leaving the natural use of the woman, burned in their lust for one another, men with men committing what is shameful, and receiving in themselves the penalty of their error which was due" (Romans 1:27). Since it is wrong to do, it is also wrong to desire to do it and to get yourself sexually excited thinking about such things.
You've stopped going to church because you think your struggles won't get better, yet now that you are not going, you've noticed the struggle is getting worse. Do you see the mismatch here? You are probably right that this particular church is not helping, but that doesn't mean the right church can't help. True churches exist to help its members become stronger. Those in the church are there "that we should no longer be children, tossed to and fro and carried about with every wind of doctrine, by the trickery of men, in the cunning craftiness of deceitful plotting, but, speaking the truth in love, may grow up in all things into Him who is the head--Christ" (Colossians 4:14-15).
What is now happening is that your are using masturbation, not to relieve yourself of excess semen but as a way to entertain yourself when you are bored.
My suggestion first of all is to find productive things to do. You really should find and go to a good church, one that follows God and not one that entertains men. If you need help locating one in your area, let me know. Get involved in learning to be a good man.
Second, stop using masturabation as entertainment. If you need to relieve yourself, fine, but not to thoughts of committing homosexual acts.