My friend

this is only attention nothing else, so you should follow this

1 find your best hobby in which you feel enjoy
2 whenewer you have free time don’t west it to think anything else just put your mind in your hobby and completely emerge your mind in this.

See the result
you will be energized and thoughts will be lost about him/her.
the main point is that the importance should be all clear from mind about him
this is process to forget all undesired thoughts.