As Salaam Aleikum,
Over the past several years, during my sleep, I happen to see erotic dreams. I would be highly grateful if you could advise me on what to do to solve this problem.
Before going to sleep, make Wudu’, pray 2 rak’ah Sunnah, then recite Ayat al-Kursi 7 times – after each time blow in all directions. If this still doesn’t work, then there’s something about your lifestyle or behavior that you need to work on.