Firstly, what is negative energy? Though energies don't have a label to them, we can categorise them as positive or negative depending upon their influences.
If a particular energy makes you feel constrained or drained then let us call it negative energy. It arises mainly due to fear. Fear can be both conscious and unconscious. When you carry fears, you emit negative energy and this might affect you and others around you.
So, how to get rid of negative energy? Firstly, know its origins or roots. Some of our fears arise from our childhood conditions or certain traumatic incidents which have caused misery in the past. Most of the tragic incidents create scars in the mind and they may or may not heal with time. When they are healed, you can be free from the negative impact of such energies.
The problem with unconscious fears is that we don't even know where they have come from and and we don't even know that we even carry them with us. But when we identify them and get rid of them, we get relieved.
How To Detect Them?
If you are distracted all the time, unable to focus on anything, or if you feel as if some hidden forces are irritating you or when you feel emotionally volatile for no reason then it means that you are affected by negative energy patterns.
Sometimes, the negative influences can come from outside. When others words, thoughts or actions keep disturbing you deeply then it means you're getting affected by their energies. If you feel totally drained after moving with someone then it could mean that you are under negative influence.
What Are Negative Spaces?
When you feel uneasy in certain places, then it could mean that those places are filled with negative energy.
What To Do About Them?
Knowingly or unknowingly, we all carry both positive and negative energies. There are so many ways to cleanse yourself of those negative energies.
If you believe in God, spend some time in any temple or a holy space occasionally; you will feel relieved.
If you don't believe in God, you can sit and meditate for a while and see the hidden fears in you arise and dissipate into nothingness.
If you believe only in science, you can always take the help of a psychologist who can figure out your hidden fears and analyse them. This may free you a bit.
If you love music, listen to some positive and uplifting music everyday. This helps cleanse your soul. This way, there are so many ways to deal with negative energies.