I am 13 years old I keep thinking of bad things, like girls, I try to fight it but I can't. Please tell me a solution for this.
Praise be to Allah, the Lord of the World; and may His blessings and peace be upon our Prophet Muhammad and upon all his Family and Companions.
Dear inquirer! You should not submit to such thinking nor to be excessive in it, since it may result in countless evils, both in religious and worldly matters.
Your only solution to such a problem is to be true obedient to Allah's orders. In other words, you have to observe al-Istiqama, i.e. you have to do what Allah likes and avoid what He dislikes; you have to be constant in religion according to the rules of the Qur'an and Sunnah in all walks of life. Such a feeling must be constant with a Muslim who believes in the Hereafter and that he will be held responsible by Allah. It is the only way towards happiness Here and Hereafter.
Allah Says (interpretation of meaning): {Verily, those who say: "Our Lord is Allah (Alone)," and then they stand firm, on them the angels will descend (at the time of their death) (saying): "Fear not, nor grieve! But receive the glad tidings of Paradise which you have been promised! "We have been your friends in the life of this world and are (so) in the Hereafter. Therein you shall have (all) that your inner-selves desire, and therein you shall have (all) for which you ask. "An entertainment from (Allah), the Oft-Forgiving, Most Merciful".} [41:30-32]. He also Says: {Verily, those who say: "Our Lord is (only) Allah," and thereafter stand firm and straight on the Islamic Faith of Monotheism, on them shall be no fear, nor shall they grieve. Such shall be the dwellers of Paradise, abiding therein (forever) - a reward for what they used to do.} [46:13-14].
In al-Musnad and Sahih Muslim and others that a man came to the Prophet (Sallallahu Alaihi wa Sallam) and said: "O Allah's Messenger (Sallallahu Alaihi wa Sallam)! Tell me something (some comprehensive guidance) about al-Islam, after which I may not ask anyone else the Prophet (Sallallahu Alaihi wa Sallam) said: "Say: I believe in Allah and then be steadfast (on the true way of religion)" . This Hadith clearly combines belief with al-Istiqama. And the best means to accomplish al-Istiqamah is to seek Allah's help, to seek refuge with Him, to perform His orders and avoid His prohibition, to follow the Sunnah of His Prophet (Sallallahu Alaihi wa Sallam), and to befriend those who follow the right path of Islam and those who call other to do so.
Furthermore, you have to avoid befriending people whose behavior is bad and those who follow their whims and caprices.
The Prophet (Sallallahu Alaihi wa Sallam), and he is the most truthful and credible, said: "The case of a good companion and that of a bad one is like that of one has musk and of one blows a furnace. The owner of the musk may grant you (some musk) or you may buy from him, or at least you may find a good smell from him; while the blower of bellows may set your clothes a fire, or at least you will breathe fumes from the furnace" . [Reported by Imams Bukhari and Muslim ].
Allah knows best.
You can search for fatwa through many choices