Become aware of your thoughts regarding your ex. Write down your thoughts as to why you feel this way. (e.g. he made big promises or told you all the things you wanted to hear)
After we lose someone, we tend to exaggerate the good things and forget the bad. To undo this damage, you need to force yourself to remember how and why the relationship ended.
Unhealthy patterns keep us stuck in a loop, repeating the same mistakes . The only way we could break that cycle is by becoming aware of it (e.g. Do you fall for unavailable men)
Fixation on an ex usually stems from a deep-rooted experience. Remember your relationship with your caregivers. Does it seem similar to your adult romantic relationships?
Reconnect with your younger self, that part of you that was wounded and is now trying to heal itself by clinging to people who remind you of those dysfunctional dynamics.
When you start missing your ex, know that this is your younger self being needy and find yourself a healthy distraction.