I think self-injury is something that is hard to truly understand if you don't personally struggle with it.
I struggle with SI urges on occasion and what helps me most is to stay busy doing something else. Sometimes I'll talk to my partner about how I'm experiencing urges to self-injure and just doing that helps me. Do you have somebody in your life that you could talk to when you feel like harming yourself? Perhaps it would also be helpful to write a list of different activities that you can do when these urges come up. You mentioned exercise which is fantastic, I enjoy doing that as well.