Could you get professional help?
Maybe try acting opposite. So when your mind tells you that you should punish yourself, do something kind instead. Listen to inspiring music, use moisturiser where you would usually SI, have a hot chocolate or your favourite drink, put on perfume, have a bath, go outside and smell the flowers, watch your favourite TV show or film, have your favourite meal or snack, have a hug with a family member, pet or soft toy, practice mindfulness.
Stay away from whatever you use to SI.