Sometimes distractions make me stop thinking about self harm (specifically cutting) for a while. I find talking or hanging out with people the most helpful, but since it's not possible most of the time, alone activities work as well. I mean music, movies, reading, whatever. I particularly like getting into some rabbit hole to keep my mind busy and forget about self harm.
Also when it gets really bad I will use unhealthy things to deal with the need to cut myself, but I guess these count as self harm as well