Gone through it recently and the best thing, even though it's the hardest you'll get round to doing is to delete their number, delete all previous conversations from whatsapp/messages, take their photos off your phone (put them in a folder somewhere you won't be tempted to look on your computer or in the cloud), block them on Facebook/social media and if you think you're going to be tempted to look by unblocking briefly then delete your account or have a friend change your password so you can't access it until you are in a place you are able to.
You have to go full no contact which includes all of the above.
Once those are actually done it actually feels like a small weight is lifted and wasn't as hard as it seems. Then you need to concentrate on yourself, keep busy, see friends/family, book a holiday and all the conventional advice you are going to find if you were to put your question into Google. Accept the sadness, have a cry when you need to, talk to your friends about it, write letters/emails to the person to get it off your chest but don't send them. It all helps.
At the moment it feels gutwrenching but in two weeks you'll feel slightly better, in six you'll feel yourself getting over them and a few weeks after that you'll feel a lot lot better. It's a cliche but time is a healer with these things but you have to do the above however hard it may be.