Most Helpful Girl
It takes a really long time, but one day you'll reach a point where you realise that you haven't thought about them for a while. Like 'Oh, I haven't thought about X lately.'
I guess the 'how' bit is just to carry on living, meet new people, and do new things. If sad/uncomfortable thoughts about the person pops up, maybe write it down to get it out of your system (that's what I did), then just set it aside.
OR another thing I did for a bit with my friend was to put $1 in a bottle everytime I thought about the person I used to love haha. Although that went horribly and all my money went into the bottle at first. It might work for you!1