I'm not remembering things I do or why I do them.
There are several explanations for your behavior, but it is difficult to know the reasoning without knowing more information about you. When a parent passes away it is challenging to process your grief whether you had a positive or negative relationship with them. It is a significant emotional event to have someone who was close to you or should have been close to you exit your life. Deaths like this require time and attention if you are to pass through the stages of grief and allow grief to have a beginning, middle and an end. Otherwise, you are sure to remain stuck in your grief. That is why it is important that you are reaching out for help. A therapist can help you explore the grief you are facing after the loss of your mother.
It is good that you recognize that you are hurting people either to push them away so they do not hurt you but in the end, you are still hurting yourself when you push people away. That is a place to begin to recognize what is going on for you. Often people display this type of behavior without recognizing that they have a role to play in their relationship struggles so it is good that you are able to see that there is some fear or subconscious agenda on your part. Recognizing the problem is the beginning of change.
You labeled your question as not remembering things I do or why I do them. This is very true of many people and a good reason to reach out for therapy. In therapy you will look beneath the surface behaviors that you can recognize and discover why you do what you do to cause what you experience in relationships. It is a blind spot to you, but as you think through your history of relationships, you might discover a painful situation that you thought did not affect your life that is really affecting you now in your current behavioral patterns.
One of the ways I help people recognize the issues that affect their behavior is through asking them to do a pleasure-pain history. I ask them to think of the three most pleasurable memories they have from their childhood and the three most painful memories they have from their childhood. This usually leads to an interesting discussion about how those very early experiences are affecting their relationships and behavioral patterns many decades later. This is often shocking as the person is not aware that the past has any affect on their current issues.
It sounds like you are at a place in your life that you're pushing people away is leaving you very motivated to change. The pain you feel from the lack of relationships in your life are leading you to reach out for help. If you are motivated to have healthy relationships, you can learn to create them.
Creating healthy relationships involves looking at why you choose to be in relationship with the people that you let in. Some people have an inborn radar that leads them to only form relationships with dysfunctional people repeating patterns of relationship that they have had in their past. It is uncanny how a person who was raised with alcoholic parents will continually be drawn to another alcoholic as a best friend or a life partner. They don’t recognize the subconscious way they are drawn to alcoholics even when they try to avoid recreating their past.
The other way you create healthy relationships is to work on you. If you want to have good friends and a good life partner, you need to be a good friend and a good life partner. You need to learn how to be loyal, dependable, kind and caring. If you lack these foundational qualities of a good relationship, you will not be able to attract people into your life who have those same qualities. Often we are looking for a fantasy of a person rather than looking for key character qualities that create healthy relationships.
It is important for you to realize that you can have the relationships that you want if you work on yourself and understand how your subconscious is affecting the relationships you have. It is also good for you to recognize that the loss of an important person in your life, like your mother, is a major life change and that you need to process this loss with purpose and give yourself time to adjust to the reality of your loss.
I hope your will follow up with counseling and find the change you want to make for your future.