Missing my ex

I’ve been having a hard time missing my ex. This only happens at night when I don’t have anything to do and I know it’s just because I’m bored and lonely. Should I try and change my thoughts/feelings? Or should I just accept them. It makes me very sad and I find myself crying a little bit most nights. Our breakup was very sudden and painful for me and I really don’t like thinking about it.