We always learn something new in life; this is an important factor in our personal growth, the most important thing about it, is to become a better person learning the lessons that life puts in our way.
Psalms 119:71 it is good for me that I have been afflicted, that I may learn your statues.
Many times, our plans dont get the results we espect, so we can get frustrated, or angry or became sad, or we can feel l lonely, etc.
Belive it or not you can get something good from all this, and it you are asking what, well, this are lessons of life, and because of this lessons we can grow spiritualy, many times you will feel humilliated inside of you, but the word of God says that in this circumstances we can learn something good, Nobody likes to go through trails and tribulations, but we are like Gold. In order for the gold to be purified needs to go through a process of pressure and heat. The process uses fire to separate the gold from the stones.
You are like gold, you can go through a process of heat and stress in your life, hard times always bring the opportunity of purified the soul. In these circumstances the best thing to do is ask God for an answer, the answer can take time, and here is when patience, faith and wisdom play a part in a lesson of life.
Isaiah: 1:16-17 Wash yourselves, make yourselves clean; Put away the evil of your doings from before my eyes. Cease to do evil, Learn to do good; Seek justice, Rebuke the oppressor, Defend the fatherless, and Plead for the widow.
The will of God for us is to leave the bad things behind, not only that, but to do the good thing from now on, How to apply this lesson to your life? Living the old life behind not necessarily has to do with crime, or lust, or drugs, or extremely dangerous things, but we can take a look at our way of life and see if there is something where we can improve.