Rituals and thoughts

I want to talk about my rituals an routines and how much my mind gets fixated on them to the point it feels like life or death And my survival depends on them. I have realised my whole life that these alienate me more and I know how obsessed I can get With them. Meaning it takes me away from others more than I would if I didn’t do them. I completely get stuck in my own world and it does scare me. I always have a sense that I need to do it to feel safe But at the same time I am so scared by the feeling isolation when I am in my rituals because I don’t know how long it’ll be before I feel safe again and I can stop. Sometimes I am triggered... by people, words. Other times I get a sense I need to do something To feel here, safe. Then I feel threatened when in the midst of them.. this is a cycle I notice. It used to be speaking to my ex. When we broke up I still had to speak with them everyday othere use my mind and sense of reality fell apart. I would be incomplete despair that I didn’t recognise the world anymore. It is still something I am trying to get past. This happens everyday on a smaller scale with minor things.
Can you relate to me? what is this & How do you cope with this?