As an empath this is always going to happen. It cannot be avoided. You will take on the emotions of others and it will hurt you sometimes. However, there are several things you can do to help. First, do your best to stay away from negative people especially when they are in a bad mood. I know this isn't always possible but anytime you can avoid them it will help. Also minimize your exposure to crowds. As your powers grow you will have a harder time with them because there will always be one or more in the group waiting to drain you or throw negative emotions at you, whether on purpose or by accident.
Second, learn to block/shield. This is very important especially if you are living with someone who tends to get explosively angry. There are many techniques and I will include a very helpful link at the end of this but I also highly recommend getting some black tourmaline. It is the strongest of the protection stones. It creates a strong shield that repels all negative energy. It also feels really good. Like a soothing balm just being near it. Get it raw, untumbled and unpolished. Completely natural. It has more power when it is untouched and fresh from the earth. Also get more than one piece. They sell it by the pound on Amazon. I recommend that. Black tourmaline needs to recharge itself after each use (something I learned myself by using it). Also use it only when you need it, when you plan to be around negative people (again so it can recharge). How I use it is I grab a fresh piece when I go out and put it in my pocket. The next time I need protection I grab a different piece.
The third thing you need is to clearing, there is many ways to do this. Meditation, smudging, reiki, crystals, earthing. One method I use is a simple salt scrub that I make. It helps me a lot. Feel free to message me and I will happily give you the recipe.
The last thing is strengthening your aura. This does two things, it not only protects you from negativity by creating a shield because you are stronger but also it grows your powers at the same time. Again there are several methods for doing this and again I am happy to share with anyone who wants to know. Message me if you want the info.