“The mind is everything. What you think you become.”―Buddha

The quality of your life depends on the quality of your thoughts, if you think negatively you create a negative life, while if you think positively you'll create a life of success and happiness.You choose your own future by every action and by every thought.
You are the programmer and your mind is the application you are creating. But the difference here is: this application is governing your whole life and turning it the way it wants based on what you've placed in it from past experiences, beliefs and thoughts. Even though experiences form a great part of our beliefs and thoughts, it can be easy to make them for our benefit. So even if you've been through a bad experience in the past, get the lessons from it and forget the pain, don't let your past control your future.
Think Positive:

Did it ever happen to you that once you were angry with someone, and thinking about his recent bad deed you kept going back through all the bad stuff he's done to you? That is a clear example of what i mean by a negative thought attracting more of its like.
How to get rid of negative thoughts?
It may seem hard at first to discipline your mind, but it all depends on your attitude, so it may take you 1 day or it may take you a full year to become positive, it is all up to you:
Try following these steps:
1. Believe :
2. Take the role of the observer:
Most of us don't realize when we are thinking, it has become a habit, but without knowing when you are thinking it might seem impossible to resist negative thoughts.so from now on try to be more aware of what you are thinking.
3. Observe
Once you realize you are thinking just observe the thought, don't argue with it or judge it, just look at it objectively.
4. Ignore:
If the thought was negative (worry, resentment, anxiety, nervousness,...) Just ignore it, let it go. You can also imagine thoughts popping up on a screen, so when you don't like a thought you can simply imagine smashing the screen with a baseball bat.
5. Give power to positive thoughts:
You might want to give attention to positive thoughts, and thus you'd be creating a positive mind and you'd get full control of your mind.
"The positive thinker sees the invisible,
Feels the intangible,
And Achieves the impossible".
Positive thinking can do magic:
- It will make you extremely happy.
- You see life differently: you start to appreciate the good things in life and ignore the bad things.
- You'll achieve the impossible: whatever seemed unachievable before becomes possible.
- You'll start getting everything positive and life would be great.