Time comes and goes, life slips and goes forth, what is to come? No creation knows.
Sometimes, things (سبحانه وتعالى) takes it away, because in His infinite Wisdom it is something which is not good for you. However, what is to say that same thing is not good for you later in life? Time can go by, a jewel can accumulate dust, but with a blow of the mouth and a brush of the hands, it sparkles like new just as it was before. Allah may very well take you away from a danger or a calamity which may be bad for you at that time, but that same ‘danger’ or ‘calamity’ could be hope and goodness for you later in life.
The point is, it is in The Will of Allah the believer should find his or her rest, because it is the plan of Allah that prevails in the end.
Translation: And they planned, but Allah planned. And Allah is the best of planners Surah Al-Imran, verse 54]
At the same time, don’t give up hope due to past problems. Because, it could be that the past hope was not good for you but it is what shines a light for you in darkness today. You may come across people that you didn’t like before but now are your best of companions. It could be that the people and things which you have shunned away from before are the torch of light that will bring life to the heart and soul today.
Translation: Allah is the Protector of those who have faith: from the depths of darkness He will lead them forth into light…[Surah Baqarah, verse 257]
True happiness is right in front of you but you need to take off your dirty glasses first to see the light which is present abundantly.