The philosopher Epictetus(AD55-135) wrote:
"People are not disturbed by things, but by the view they take of things."
If you look closely, you will find that by far the greater part of any unhappiness in you is created not by situations, but by what your mind is saying about them. It's created by the self-talk in your head. Such dysfunctional thinking strengthens the ego, but it weakens you. How to end it? Meet situations and people without judgment. Don't indulge in mental movies about past and future. Give your fullest attention to the present moment without mentally labeling it. This is the arising of Presence, a new state of consciousness that frees your mind from its old conditioning. This new consciousness will give rise to a new world.