A young woman in a difficult situation cried, "But I asked God for wisdom and He didn't answer me!"
"Yes, He did. This is it. Now you know what not to do next time."
God's wisdom doesn't magically or immediately prevent hardship, trials, or discomfort. Instead, He desires to help us learn and grow through it. God shows Himself greater than the difficulty. He is with us through the difficulty. He allows difficulty to create dependence, humility, patience, steadfastness, and spiritual growth. The goal is not avoidance of difficulty--though that is often what we want.
Asking God for wisdom does not negate or repel trouble. Asking God for wisdom and expecting it to dissipate is like the individual who ended up in the Emergency Room because he applied bear repellant--to himself--instead of the bear. We must use God's Word according to the instructions. And God says it's a life-long process of learning, growing, and depending.
The question isn't, "Did I avoid trouble?" Instead, the questions are, "What did I learn?" "Was I dependent on God, myself or others?" Did I worry and fret, seek to manipulate or coerce others into doing what I wanted, or did I pray and wait?
The word for "trouble" in James 1 is something we can't avoid--like Mr. Magoo we fall into the manhole of difficulty not necessarily because of sinful choices, just because. That's normal. It's how we grow.
Consider it all joy, my brothers and sisters, when you encounter various trials, knowing that the testing of your faith produces endurance. And let endurance have its perfect result, so that you may be perfect and complete, lacking in nothing.
But if any of you lacks wisdom, let him ask of God, who gives to all generously and without reproach, and it will be given to him. But he must ask in faith without any doubting, for the one who doubts is like the surf of the sea, driven and tossed by the wind. For that person ought not to expect that he will receive anything from the Lord, being a double-minded man, unstable in all his ways. (James 1:2-8)