Remove them from your reality by either killing the attacking astral entity as you would a parasite, or if you don’t want to attack them, use sympathetic magick to lock them away from you. I’ve tried both and both work fine.
Attacking astrally is simpler but needs more energy and sustained work. Locking them away from you is a kind of binding. Get the sympathetic objects or links that represent how they connect to you, or make a poppet that represents them, get a metal tin and some metal chain from the hardware store… ceremonially place the objects in tinfoil, then in the tin, then wrap the tin in cloth, then the chain, focusing on how deep your binding them into darkness away from your reality with every layer.
I did this as the final thing that worked to remove my having intrusive thoughts about a person, which was due to magick on their part. You must follow it up by not approaching them mentally or astrally either. I don’t know if this would work if you continue to meet them in the physical.
Or, watch what they do learn the techniques and and copy it right back.