When I self harm which happens occasionally, I also feel ashamed, so I hide it from my husband as best as I can. Because I don’t want him to get sad or upset. So I understand why you’d feel ashamed.
However self harming is a cry for help - and for that don’t be ashamed at all! It’s ok to not be ok, but don’t give up. You are valuable with valid emotions. Sometimes it gets too much I know. But talk to someone about it.
Hope you feel better soon!