tudy,
Part of the problem sounds familiar in that you're getting moments of anxiety, the key thing to remember when it comes to anxiety is that the more you think about it the worse it can get as you worry and become anxious over how bad you're feeling/the thoughts you're thinking. Instead try this:
Look up some breathing exercises for overcoming anxiety online. A simple start until you've done that is anytime you feel like it's all too much and you're losing touch with reality just try and think of nothing but your breathing. Just sit still for a moment, close your eyes if it helps, and focus on your breath in and then out, in and then out. If a thought pops up, even one like "this is silly" or "this isn't helping", don't address it directly or start thinking further about it. Just know that it's a thought and that's all it is, it's words within your mind.
Focus on your breathing and believe that you're going to be ok, the worst has passed you by and now you're on the way to feeling better and at home in yourself again. If you want to take it a step further you can put your feet firmly on the ground wherever you're sitting and imagine roots coming out of your feet into the floor, connecting you with the Earth and everything in it. You belong here, you're a person in a world of people and your mind and your thoughts don't have to lead you, you can choose to find a place of calm anytime you feel like it.
Some of that might sound 'new-agey' or like bullshit, which you know what on the surface it is, you aren't really sprouting magical roots or harnessing some secret power, the point is your mind is what is making you feel anxious in the first place. What drives your mind is your intent, conscious or unconscious, so believing things will be ok and using little tricks like these to distract you and reconnect you to the real world will help.
Last but not least: stick with it, other people have been where you are now and they've come through it. We all face challenges but that's when we need to figure out a way to come through them, don't give up!