1. ACCEPT THAT IT IS PRETTY NORMAL TO HAVE S8XUAL URGES
To control your s8xual urges, you must first accept that there is nothing wrong in wanting s8x or thinking about it. It is a pretty normal phase everyone goes through, unlike what we have been made to believe by some societal factors like religion that s8x is evil and having s8xual urges is a complete taboo. You have to know and accept that your s8xual desires are just one of those basic physical needs that seeks to be fulfilled one way or the other and that we are wired to think about s8x. Once you have accepted this fact and you strongly wish to put it in check, you can control it.
2. KNOW WHAT TRIGGERS THOSE FEELINGS
In order to control your s8xual desires, you must know what it is that actually sets it off. For someone who is s8xually starved, it is easier to be drawn by s8xual innuendoes and signs, making it tough to control your urges but once you have identified those things that these feelings, you mind will be alert enough to steer clear of them. Avoid reading books with x-rated contents or watch p8rnographic movies or any form of object that can stimulate your s8xual urges.