If you notice yourself doing these things, take the time to mirror your reason for feeling so uneasy around people. Or for anyone who has noticed a friend acting by doing this, understand that their behavior isn't a reflection individuals. Your friend doesn't hate you, they are just a little time for you to recoil and recharge their energy. When those who are a bit more introverted or socially anxious enter into these funks, they don't stop loving their friends. I can tell you against my own experience, I'm so thankful for the good friends I have who realise why I want just a little space sometimes and support me through my funks.