Everyone has this habit of being afraid of strangers and separation. This is a natural feeling of fear. Now you don't know how to face it, which only shows one thing: you are still young, at least your mental age is still very young. I guess you are around 20 years old. Full of novelty about the outside world, but lack of experience.
From your narrative, I feel that you are eager to interact with strangers in order to show your personality charm, but your natural fear makes you afraid of being hurt, or you have had similar experiences before a negative hint. That's why there are so many doubts and uneasiness. This is not a disease, but a normal reflection of people. When you realize this, you will be more comfortable handling conflicts between the two parties when making friends. You will know how to deal with it when two people have different personalities.
First of all, remember not to rush for quick results. Real friendship can only be achieved after going through running-in. This running-in may take several years or more than ten years. As you said, when we meet for the first time, we always feel repelled and defensive. I wonder if you have such thoughts. Only when two people interact more often and get to know each other will they slowly relax their vigilance and interact more deeply. Some people even need two or three years of hard work to become close friends with them.
Secondly, understand that this mentality is not your own negativity, and that making friends is not perfect. The next step is to treat this matter correctly. When you want to interact with someone, I think the most important thing is to have confidence in yourself. This does not mean that you have to conquer him, but that you believe that he is worthy of your relationship and that you need to become friends with him. Only in this way will you have less scruples. As for the issue of injury, you have to believe that this is a risky investment, and as long as the injury can be minimized, it will be good. When the relationship between two people makes you feel threatened, it is appropriate to take a few steps back and wait and see. Continue the relationship only if you are sure there are no problems.
Again, people cannot live without friends. Although it involves risks, people are still looking for them everywhere optimistically. The reason is to find close friends. However, true intimacy requires talking to each other without reservation. You have so little communication with strangers that you don’t know how to deal with them. If you really need friends, more friends. You should try to interact with strangers who have always been in contact with you in the circle around you, and slowly understand the mystery and experience the thrill. Maybe one day you will be obsessed with that kind of excitement. Even as you accumulate experience, you will become more comfortable with it.
Finally, stop immersing yourself in your own loss, hint to yourself that I can cope with all difficulties, and step out of yourself boldly. Take action and you will slowly stop feeling the discomfort.