Committing Incest and to think about it is very different. Its like thinking about drinking and actually drinking. The outcomes are seperate.
Now, thinking about incest can have two possibilities. One, it disgusts the thinker. Two, it doesnt. The latter situation can lead to more differnet possibilities. Harmless masturbation to even sexual assult.
To help you understand, if youve heard about oedipus and electra comples than you would know that these kind of thought are generated from pure primal instincts. Mating in families is common in nature. Now this kind of acts after generations turns into reflexes and those reflexes cause the thoughts in the first place.
What im trying to say is having such thoughts are common. But they occur only in adolescence. Now to avoid these thoughts is easy. Get youself a hobby to pass leisure. Delve your thoghts into something productive. Play sports. Dont coup yourself up in your room. Get fresh airs and engage in activities. You will get rid of such thoghts in no time. Though masturbation is scientifically proven not to be unhealthy but excessive amountsmight cause perversion in charecter. So practice self control and aforementioned things and you are solid.
I take it that the person in question that you're having these thoughts about is probably your sibling.
Well I think the only way to stop thinking about incest is to get your mind off it completely by keeping yourself busy with other things. As the saying goes, an idle mind is the devil's workshop so if you keep your mind busy then no thoughts of incest will creep in.
Secondly, thoughts like this are just like drug addictions, they have triggers which make people think about them so the best advice I can give the person is to remove yourself from every situation that could trigger the thought and stay away from people that make you think about it too.
It could be that the person is simply just horny and in need of some action and the only thing that's available for them to see is their relation or sibling. A quick fix would be to get a partner or at least somebody that they can actually have sex with frequently. Chances are that if they satisfy their sexual urges then they won't be attracted to their siblings anymore.
Thirdly, self control is key, when you think about something, you haven't actually done it yet, you only perceive it. Doing it is a completely different thing entirely, so while the person is trying to overcome these thoughts, he/she has to show a great deal of self control.
I hope this helps.