Try not to worry when things don't go your way, when you make mistakes or when people do wrong by you. All these events that happen in your life are building your character.
As long as you can look at things in a way that you can learn from them then they're not a waste and they are for the greater good.
Everything that has happened to me - good and bad has been for reason, although I didn't think that at the time. When you're dealing with things in the moment, you're consumed by it and you're emotions and that's all you are able to see. Take control of your thoughts and pull yourself out of the situation.
There's no point thinking negatively about it. Deal with it the best way you know how but don't stress about it. You will look back and be grateful for your experiences - they all add to who you are - your character and your wisdom.
Every experience is a stepping stone.