Well, if it is a sexual habit (since that is how this is tagged), your body has hormones, and it is dealing with your hormones in its own way. As Shaykh Esmail said, it will likely calm down. Reciting Qur'an and du'a before sleeping may also help calm things down. Adjusting what you eat may also have an effect.
Also, as Shaykh Esmail said, we aren't held accountable for what appears in our dreams (although maybe it might be embarrassing). At the risk of sounding overly traditional, the main solution given in our texts is to get married and find a different outlet, of course that is often easier said than done, but if you aren't married, that is the advice that is given.
If it is some other kind of habit, you can ignore the above!