Summarize this article:

Spend some time thinking about your behavior and what leads you to have sexual impulses. Think about triggering stimuli, the time of day, as well as the environment in which you tend to have these urgings. See if there are any patterns that emerge in your behavior.  If you have discovered a pattern, figure out how you can break the cycle with new behaviors or lifestyle changes. For example, you may notice that you feel most overwhelmed with sexual urges in the evenings and on weekends -- when you are not working and don’t have anything to do. You may decide to take up a new hobby in order to keep your mind off sex. Perhaps you are triggered by stimuli in your environment. If you find yourself aroused by steamy love scenes in movies, for example, it may be best to watch other kinds of non-romantic films until you can get a better grip on your urges. Consider keeping a journal of your actions and behavior leading up to sexual urges. A journal can help you identify triggers and patterns. Pornography has turned into a billion-dollar industry, and viewing it is more acceptable than ever. This makes pornography difficult to ignore, but as it rewards sexual urges, it is best to avoid viewing it if you are prone to troublesome sexual urges.  You may wish to put browser extensions or parental controls on your computer to make it difficult to access pornography on your computer. You could even have a friend or your partner install it and not inform you of the password. Throw away any pornographic magazines, books, or movies you may have. You may wish to avoid masturbating for a set amount of time to help you get your sexual urges under control. For some people, abstaining from masturbation may be more important than for others. You may wish to get suggestions about what would be appropriate for you from a therapist.  For example, if you feel you masturbate compulsively, it may be a good idea to commit to abstaining from masturbation for a set amount of time. This may also be appropriate if you have a porn addiction. For other people, masturbation may help you improve intimacy and improve your sexual health. Drugs and alcohol can cause you to lose your inhibitions, including your sexual control. Stay away from parties and scenarios you think might be problematic. Being under the influence of drugs and/or alcohol makes it more likely that you will engage in risky sexual activity. Look for mental techniques you can use to help “change the subject” in your brain, when you begin to feel overwhelmed by sexual urges. You may wish to talk to a therapist about ways to manage obsessive thoughts. Some techniques may include:  Clearing your mind through meditation or mindfulness. Don't give up if this is very challenging at first! It is for most people. Have faith that it will get easier with practice. If you have a spiritual practice, you could also try prayer to help you focus your mind and get spiritual support. Shifting your attention back to your present task. Acknowledge your sexual urges by telling yourself something like, “These are only thoughts. Right now they are not helping me, but hurting me.” Then take a few deep breaths and shift your focus back to your current activity. Sometimes obsessive thoughts tend to creep up on you when you are feeling overwhelmed and stressed. If you find this to be true for you with your sexual urges, figure out ways you can live a less stressful life.  For example, you may find yourself obsessively thinking about sex on days when you are running late for work. Experiment with earlier wake-up times or allowing extra commute time to see if your thought patterns change. Make a list of various responsibilities you have and see what you can eliminate or delegate. Try to work smarter, not harder. Staying busy helps keep your mind preoccupied and focused on things other than sex. Take up a new hobby or fill your social calendar with activities with friends.  Channel your sexual energy into a creative project. Working through difficult emotions through one’s imagination is a form of sublimation, or taking a “negative” or unwanted emotion and turning it into something more positive or useful.  Find a hobby that takes you away from triggering stimuli. For example, if you have a tendency to view porn at home alone, find a hobby that takes you out of the house and surrounds you with people, so that you are not in a triggering environment. Physical activity is one of the healthiest ways to control and manage a range of feelings and emotions, including the urge to have sex. Exercise regularly to combat sexual energy, or head to the nearest park or gym as soon as you start experiencing these feelings. Consider setting a fitness goal on which to focus. For example, you may decide to lose weight, lift a certain amount at the gym, or train for a race or long-distance bike ride. When you are not working out, you can spend time researching how to achieve your particular fitness goal, rather than be distracted by sexual urges.
Identify the triggers for your sexual urges. Avoid pornography. Consider avoiding masturbation. Abstain from drugs or alcohol. Find effective methods to control your thoughts. Minimize stress. Keep yourself busy. Exercise.