Philippians 4:6 Be careful for nothing; but in every thing by prayer and supplication with thanksgiving let your requests be made known unto God.
1John 3:22 explains that whatsoever we ask of God, we will receive because we keep His commandments and do those things that are pleasing in His sight. Here we have some of the conditions mentioned throughout Scripture for answered prayer which always includes obedience. Five secrets are noted here: Freedom from condemnation (Rom. 8:1). Confidence in God (Heb. 3:6; 10:35; 1Jn. 2:28; 3:21; 5:14). Asking (Matt. 7:7-11; Luke 11:9-13). Keeping commandments (1Jn. 3:23-24). Pleasing God (Heb. 11:6; Jas. 1:5-8).
Looking at some more reasons for unanswered prayer we can discern the following: Lusts (Jas. 4:1-3, 5; John 8:44); murders (Jas. 4:2); covetousness (Jas. 4:2); fighting and war (Jas. 4:2); asking amiss to satisfy lusts (Jas. 4:3); adulteries (Jas. 4:4); friendship; pride (Jas. 4:6); rebellion against God (Jas. 4:7); backsliding and sin (Jas. 4:8); double-mindedness or doubt (Jas. 4:8); the misuse of the tongue (Jas. 4:11-12).
This passage should never be taken by the Christian as an excuse for unanswered prayer. By so doing he automatically classes himself as lustful, murderous, covetous, adulterous, worldly, proud, sinful, and blasphemous. Is it any wonder that God does not answer the prayers of such people? Would you? No man can ask amiss if he is in Christ and asks according to the promises (John 15:7; Mark 11:22-24; Heb. 11:6; Jas. 1:5-8). The reason Christian prayers are not answered is unbelief.