Tell him honestly
If you want to get rid of a guy, you must try to be honest with him. No doubt, that telling someone you have no interest in him can be very difficult but you should realise the need and do it. If you expect the guy to read your mind and have clue of what you want then you are making a big mistake, as it is not possible for everyone. In addition, you can just tell the person that you do not intend to be in a relationship with anyone else or state any other reason you have.
Do not let him contact you
You should never allow such a guy to contact you as this will give him hope and he will have a feeling that there might be a chance. If the guy wants to contact you, you must ignore him and if he just keeps on pushing, you must not answer to his calls or messages. You can also contact your phone service provider and have his number blocked. It is important that you get rid of all the texts and conversations, which you had with that guy.
Tell him face to face
You should tell the guy about your feelings face to face. You must not give him hope and sound very clear that you are not willing to be in a relationship with him and you do not want to talk to him anymore. Nevertheless, it is important that you must act sympathetically while telling him about his feelings otherwise he will be hurt badly.
Obtain restraining order
If he does not listen to you, you must file a formal complaint against the guy and obtain a restraining order. It may sound odd to you but some people just cannot leave others and thus restraining order is the last resort.