Wilaya, piety, belief, faith ... We often make the mistake of imagining that these wonderful things lear to a problem-free life. But this is a bit too simplistic. The awliya can suffer from various things lile poverty, troubled spouses, or wayward kids. However, nearness to God does guarantee a couple of other things, maybe even more valuable. Usually, when the Quran promises to remove problems, it is these:
1) It guarantees that your problems are not ones that could have been avoided. Problems resulting from alcohol, drugs, children out of wedlock, and many many more, will be avoided by someone keen on living the Shari'a. Problems are not only external either. Envy, hate, greed, meaninglessness, are all inner problems that the Prophet's guidance leads us out of.
2) It guarantees the general understanding of *why* bad things happen. By understanding the source and wisdom behind pain, hardship, and loss, we can actually convert them into benefit and gain.
3) It guarantees us an answer to "what went wrong?" When we fall into a long-term rut, a continuing problem that won't go away, it is always a result of some incapatibility between our behavior and the Shari'a. In other words, not doing a fard or committing something sinful. Or it can be internal: lack of patience or trying to control things that are not our right to control.
4) It guarantees us that the future will be better than the present, because a mu'min is always in increase spiritually. And Akhira is superior to dunya.
5) Most of all, it guarantees a way to assuage our inner pain through dhikr. Dhikr is a serious discipline. With time, one's private dhikr sessions yield such a feeling of calmness and sweentess that one forgets the world and what is in it.
In sum, problems are pain. There is no such thing as a pain-free life. But it's not really pain that we hate and fear, since we inflict pain on ourselves and others when we know for sure that the benefit outweighs the harm, for example chemotherapy. What we really hate is being in the dark about the context, purpose, and way out of the pain. A life near to Allah and His law grant us answers to those things.