All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
Hypnotism refers to two types of practices, each one is different from the other. If it is based on the use of jinn, it is forbidden, even if one's intention from it is good; please refer to Fatwa 82563. If the hypnotism is based on inspiration and psychological practices, and it does not involve any prohibition, such as music for example, then it is permissible provided it is used for something is good, like treatment or the like; please refer to Fatwa 267148.
Assuming that you listened to forbidden hypnotism, then you must repent from it; the conditions of repentance are explained in Fatwa 86527. Whoever sincerely repents, Allaah accepts his repentance. The bad thoughts that you had are not necessarily due to those practices. In any case, you must try hard to repel these thoughts by seeking the help of Allaah, remembering Him, and reciting the Quran.
We ask Allaah to cure you of every affliction.
Allaah Knows best.