In my own life, I have found a fairly good practice for when I begin to think that I dislike someone. Before I get into that, I would like to share what works for me to avoid that altogether.
Every time I meet someone new I can't help but love them. Until someone shows me that he or she isn't a wholesome person, I treat them like I would wish to be treated. This usually creates a friendly and loving environment right off the bat.
When I come across someone or someone that I know (or maybe even don't know) gives me reason to believe that I should not keep him or her in my life I start asking myself questions. I begin to think of reasons why I feel aversion to the person. This forces you to put yourself in the other persons shoes. Think about the reason you feel ill-will or dislike (they aren't the same but they aren't different). Maybe the person did something to hurt you, did something that you don't approve of to someone else or acted out of selfishness. Whatever the reason may be ponder for a while on why he or she may have acted that way. Really think about it. If it's someone you don't know then maybe they are just having a bad day and took out their anger on you for whatever reason. If it's someone you do know, first ask yourself the same questions as you would a stranger but go further. Is the reason you dislike someone caused by an annoyance such as a personality trait or habit? Did they do something specifically to hurt you? Is this action out of the ordinary?
Get to the root of your dislike. Using clarity to figure out why I feel an aversion to someone makes something click in my head. I realize not only why I am feeling dislike but I also learn the reason for the other person's behavior. The reason is always the same. The person is suffering in some way. A lot of people cling to things and get upset when they are without, desire things that are unattainable and get angry over things that they cannot control.
The world isn't perfect and people are going to do things that may cause you to feel an initial feeling of dislike. The only person that dislike harms, though, is yourself. Wasting time thinking about why you don't like someone wastes precious time that could be used to do something positive. It also creates an unwholesome moment. A current unwholesome moment creates another unwholesome moment and before you know it you're angry upset and confused and most likely don't even remember why.
When this feeling comes up in myself l contemplate on the subject quite a bit. I usually try to solve the problem by approaching the person in an nonthreatening manner. I start by letting them know that I feel that they are suffering and ask if they need someone to talk to. That's a much bigger deal than most people think it is. Giving an open ear can not only give the other person a healthy outlet to release whatever may be going on inside but also gives you the power of knowledge. This also helps me recognize any fault that I may have and gives me an opportunity to apologize which usually makes the person feel better if it had anything to do with me to begin with whether I knew it or not. When you know why the other person is doing harmful things, you know for the future that the same thing may happen and you are better prepared to handle it.
Sometimes people don't want to talk, though, or perceive your motives the wrong way. If that's the case, just let it be. What helps me with that is meditating on the person and the situation. Every night while I fall asleep I wish for the happiness of all sentient beings. When someone has hurt me, I take out a specific time to meditate on that. I make sure that I have the situation straight in my own head. I put all possible biased opinions aside so there is no fog to cloud the true meaning of the energy I am about to send out into the universe. I go back over everything in my head. As I come to the instances that brought up my feelings of hurt or dislike I think about how much that person must have been suffering to do the things that upset me. I can't stand the thought of others suffering. I have always been very empathetic so it came fairly natural to me but I definitely had to work on it before I really and truly realized that no one should suffer- not even people that I disliked. Loving kindness and understanding are very large parts of Buddhism that must be developed fully within one's mind and heart before moving on in the Buddha's path is a possibility.
So that's what helps me when I get that feeling. You don't necessarily have to purposely wish ill-will upon someone to cause harm. Realize that you asked this question for a reason. You must be an amazing person to even ponder that in the first place. There are a lot of people out there that don't care. Or that thrive on wishing harm upon others. Just by reading your question, I've learned that there are other people out there that struggle with some of the same things that I do and that's comforting in itself. So, I would lije to thaj you as well for reminding me of this practice and it's importance in my growth. Hope I helped a little. I wish you the best! Much love and peace