James said that if you ask God for wisdom in times of trials, God will give it to you without blaming you for past wrongs. But there is one essential requirement in order to receive God’s wisdom. “But let him ask in faith, with no doubting, for the one who doubts is like a wave of the sea that is driven and tossed by the wind” (Jas. 1:6, ESV). You must ask by faith, nothing doubting. “Faith” here is from pistis, which means in this context, “total trust in God with no room for doubt.” I like how Albert Barnes defines faith here—“utmost” and “unwavering confidence in God.”
There’s an untold story of Mylene. One day, we had no money left to pay for the medicines and daily dialysis of her father, the late, Rev. Andres Pepito. Rev. Pepito’s 2 kidneys already failed. Mylene needed at least P10, 000.00 to pay for it. We prayed. We trusted the Lord. Mylene had faith—the unwavering confidence that God will provide. Then the next day, somebody dropped by the house and prayed for Rev. Pepito. When he left, he gave Mylene money. The amount? Exactly P10, 000.00.
Look at v. 6. “No” in “no doubting” (ESV) is medeis—“not at all, in no way” in the accusative case (BAGD); “not even one” (Strong). “Doubting” is from diakrino, “be at odds w. oneself, doubt, waver” (BAGD); “hesitate; dispute, debate, take issue” (Newman). It means hoping that God will give you wisdom, while fearing that He might not give it. The idea here is disputing and debating and deliberating the issue, with no assurance of certainty.
You cannot come to God asking for wisdom, while doubting if you will indeed receive it. It’s like praying, “Lord, please give me wisdom in this trial. But I doubt it!” James is saying, “While you ask in faith, there should not even be one thought of doubting God and His wisdom.”
 Albert Barnes, Albert Barnes’ Notes on the Bible, Power Bible CD.