Praise be to Allah
You have to do a number of important things:
You have to put out of your mind these negative feelings that are overwhelming you. Allah, may He be glorified and exalted, created people physically sound and well balanced, and they do not become unbalanced except when developing problems in exceptional cases of illness. Most people, however, are moulded in a precise, proper and perfect way and would not develop any problem except in cases of real illness that require treatment by specialists. If you are not really ill, then there is no explanation except that what crosses your mind is nothing but insinuating thoughts that you should ward off and resist. You can do that by diverting your attention away from these matters and reinforcing the opposite, namely true feminine feelings, calling to mind the blessings that Allah, may He be glorified and exalted, has bestowed upon you and focusing on obedience to Him. In this world you can never run out of things to do that are beneficial and there are always genuine opportunities to attain success, righteousness and piety in this world. So if you really focus on these beneficial things, and strongly resolve, on the basis of rational thinking and willpower to reject all thoughts of wanting to be a man or any idea of changing your gender, then you should know that in that case you will be following the right course of treatment and you will attain the psychological stability that you are seeking and aspiring to attain, in sha Allah.
Believe us, we are not repeating something that has no impact, and it is nothing new. Rather it is based on experience and knowledge, and we are telling you this out of compassion for you, as the Shaytan is toying with you by means of these feelings. You are going to be the main cause of your own suffering if you give into these negative feelings and defend them and justify them on the basis that you are unable to ward them off. That is nothing but weakness and lack of resolve, which will lead you to doom unless you take decisive action and resolve to seek treatment and healing.
Allah, may He be glorified and exalted, says (interpretation of the meaning):
You should consult a specialist medical doctor or psychiatrist, even if you are certain that you are not a lesbian. These thoughts that cross your mind may be the result of some kind of mental illness, and there may be a physical cause having to do with hormone imbalance and the like, which requires treatment by a specialist.
It is essential to seek help by all possible means to resist these negative feelings. So seek the help of a specialist doctor who deals with fertility treatment and the like (for hormonal imbalance issues), and of a psychiatrist or psychologist too, for they may have other means and suggestions that could help you to overcome this problem, in sha Allah. Do not hesitate to do this, for what matters is that you should take all measures and be hopeful and optimistic, thinking positively of Allah, that He may decree healing for you by His grace and bounty.
Be sure that feelings of wanting to be a man that cross your mind are sinful feelings, if you respond to them and behave accordingly by acting like a man, doing masculine things and being put off marriage because of that. Indeed these matters are the gravest of sins before Allah, may He be glorified. It was narrated that Ibn ‘Abbas (may Allah be pleased with him) said: The Messenger of Allah (blessings and peace of Allah be upon him) cursed men who imitate women and women who imitate men. Narrated by al-Bukhari (5885). Imitation is a general word which includes outward appearance, as well as feelings and thoughts if a person gives free rein to them and does not resist them. Anyone who tries to resemble the other gender and responds to thoughts of imitating the other gender, both outwardly or inwardly, is included in this curse and sin before Allah, may He be glorified. This is quite clear and is something well known.
Beware of responding to the call of Shaytan with regard to delaying marriage on the basis of a so-called sexual problem. In fact marriage is a remedy to this problem, in sha Allah, but that is on condition that there be a determined resolve on your part to treat the problem and to reinforce feminine feelings in your heart and to seek help from a doctor to whom Allah has taught the means of treating this problem also. In that case marriage will be a means of overcoming the problem and dealing with it. As for withdrawing and isolating oneself from natural life, that will only increase you in sickness and will help the Shaytan against you.
In all these matters seek the help of Allah, may He be glorified and exalted, by calling upon Him, asking of Him, turning to Him, humbling yourself before Him and remembering death, the resurrection and the gathering for judgement, for thinking of death destroys all temptation and extinguishes all desires. By doing that, you should be keen to make sure that you read the Book of Allah and ponder its verses and meanings, and regularly recite the adhkar of morning and evening, by means of which Allah will protect you from all evil, by His leave.
To sum up:
The remedy to your problem and suffering is based on three things:
1. Fearing Allah and being conscious of Him, and being cautious not to overstep His limits.
2. Strengthening your willpower and resolving to take necessary measures to treat the problem, and not giving free rein to your negative feelings.
3. Taking measures to obtain physical and psychological treatment to deal with the problem, and consulting specialists in those fields.
And Allah knows best.