Not sleeping much since breakup

K`Nesha

I recently broke up with my bf and I haven't been sleeping much. At some points during the night I'll wake up and think about him and then it will take a bit of time to fall back asleep. Other times I would see him in my dreams and that would wake me up. Since I'm in and out of sleep so much I'm exhausted in the mornings and sometimes I would get headaches. Does anyone know any tips to help me sleep through the night? I've tried taking melatonin but it only helps so much. TIA!