Before deciding to cut someone from your life, be straightforward towards that person. Let them know how you feel and why you feel a certain way. Give them a second chance to better themselves as friends and then decided if this person is still toxic or not.
If you ran out of chances to give then create plans and volunteer places to keep you busy. Add the focus to typically gave them and place it elsewhere in your life so there's no excuse to meet up with them.
When the person messages and ask you to go out, you won't have to make up an excuse. Having actual plans to be somewhere or planned projects are good reasons to cancel on someone. Putting energy towards a goal instead of towards someone is a better way to spend your time.
The next step is to not completely avoid their messages but to avoid messaging first and often. Do not share personal details of your life. Nothing tells someone these days that they aren't a close friend like finding out information on social media first. Keep the conversation as general as possible. Even if you found the most relatable meme and you know they'll enjoy it.
If they message you first then reply as you would reply to someone who you accidentally swiped right on. Keep it classy but also like you're just trying to end the conversation.
If you stop contact in person and in a text, eventually the toxic person will find someone else to spend their time with. Know your worth and figure out who is toxic in your life.
It doesn't matter how long you've been a friend with a certain person, if they are keeping you from doing things and making you feel bad about yourself, they are toxic.