Very few people in this world are aware about what they do every day, therefore be proud of yourself that you are able to do such a self-assessment. A person who realizes his shortcomings always comes out them. Solution to your problem is not that difficult.

Mainly, you just have to repent for the attractions and ask strength from God that I don’t want to get attracted towards any girl. If you do this much, the problem will start decreasing and will also dissolve after some time.
Let me explain in detail.

Our own Past Karma is the cause
Typically, we assume that God made me sexual. But in reality, it is your own past life’s karma that is the cause of it. In past life, you seem to have consciously made ‘intents’ to get attracted towards girls and therefore in this life you are facing such circumstances.
God is neither creator nor destroyer. If God has created this, then who shall give him a punishment for making you sexual?

The fact is that the entire world runs on science of karma. Whatever ‘intents’ you make in this life, they will come as effects in next life. Therefore, if you’ve made a strong intent in past life that ‘I want to get attracted to girls’, and then in this life you will naturally become attracted and face the consequences. So we should always be careful about making ‘intentions.’ Anyways, what’s happened has happened. What can we do now?...

Repent and ask for forgiveness
Whenever the situation of attraction happens, don’t think negative about the girl. Immediately see the Pure Soul within her and tell her Soul that “I am very sorry that I got attracted towards this girl, please forgive me and give me the strength to not involve myself in any sexual activities (including attraction). I will not indulge in any sexual activities henceforth.”

The moment you earnestly repent and ask for forgiveness for any mistake that mistake begins to leave and it gives you more strength to not get involved in sexual attractions in future.
More the intensity of the ‘intent,’ more the asking for forgiveness.

With just one act of seeking forgiveness, the habit of attraction will not go away. Sexual attractions are like onions. When you ask for forgiveness, at that time only first layer gets washed. At the time of second sexual attraction, if you again ask for forgiveness, then second layer will also get washed, just like you peel off the multiple layers of an onion one by one.

The stronger the ‘intent’ you made in last birth, the more intense the forgiveness should be. Therefore, every time you have sexual attraction, you must ask for forgiveness immediately. More the layers, more the forgiveness needs to be done. Slowly slowly the frequency and intensity will reduce and go away. Don’t lose your strength and just keep the faith.

Ask strength from God
Every day, before you start your day, ask God to give you strength to remain free from sexual activities. I do this prayer everyday to remain free from sex and sexual activities. This prayer is written by Dada Bhagwan Foundation (www.dadabhagwan.org), which I am sharing with you:

Dearest God (Pure Soul within), give me the absolute inner energy to not have, nor cause to have, nor instigate someone to have any sexual desires, feelings, or gestures towards any living being, be it male or female or of bisexual orientation. Give me the supreme energy to be eternally free of sexual desire.

See what lies within you
Once in a week, sit down quietly and try to analyze why the attraction is happening. Some people feel that sexual attraction gives them lot of security or they derive great pleasure from it. Your reason could be different, and therefore you need to analyze.

Once you know the reason why sexuality interests you, you can give positive reinforcement to get out of sexuality. Example: If you are attracted because it gives pleasure, then talk to yourself and convince it to get out of these pleasures. Does the pleasure remain for 24 hours? Does it make you permanently happy? The answer is No. So just explain to yourself that there is nothing to gain in these attractions and in fact it will distract you in your life.

God lies within you
Our ‘Pure Soul’ is the God within us. The Soul is permanent i.e. immortal. When we die, our name, body, fame, money everything goes away. Only the Pure Soul within us does not die. It travels from one body to another. At the time of death, based on our karmas, the Soul travels from the present body to another women’s uterus as an embryo!

Our real identity is that we are a Pure Soul, we are immortal and we have divine knowledge, energy, and vision. You can attain your real identity as a ‘Pure Soul’ by taking Self-Realization from Gnani Purush Pujya Deepakbhai, a committed devotee of Gnani Purush Param Pujya Dada Bhagwan. He imparts Self-Realization and gives knowledge of Self (i.e. Pure Soul for free, no charges).

He himself is free from ego, sex, anger, pride, deceit, greed, attachments and abhorrence! You can refer to some of his spiritual discourses on celibacy/brahmacharya that provides various solutions to problems regarding this subject. There are several books on brahmacharya at www.dadabhagwan.org, which you can refer for details.

Please refer to this link: https://www.dadabhagwan.org/path-to-happiness/spiritual-science/practice...

Author's Bio: 

Ambalal M. Patel was a civil contractor by profession. In June 1958, spontaneous Self-Realization occurred within Ambalal M. Patel. From this point on, Ambalal became a Gnani Purush, and the Lord that manifest within him became known as Dada Bhagwan. A Gnani Purush is One who has realized the Self and is able help others do the same. Param Pujya Dada Bhagwan used to go from town to town and country-to-country to give satsang (spiritual discourse) and impart the knowledge of the Self, as well as knowledge of harmonious worldly interactions to everyone who came to meet him. This spiritual science, known as Akram Vignan, is the step-less path to Self-realization.