I had a haram relationship with a boy i broke up with him and now my heart is attached to him, i get bad thoughts that i cannot be happy with anyone else and this is the man i ll be happy with. I get thoughts that since i did wrong therefore its better to marry him but i also know that he is not good for me? How can i overcome.
You did the right thing by repenting to Allah and breaking up with him! This doesn’t please Satan and this is why he is doing his level best to get you back to sin and to make you anger Allah more and more so that you and satan would be in the same boat.
Part of your repentance is to never get back to such sins again. Therefore, if you want Allah’s forgiveness, you must not ever think of that person at all and pray to Allah that He sends you someone who is righteous and practicing as a husband.