Do not be deceived, my beloved brothers. Every good gift and every perfect gift is from above, coming down from the Father of lights with whom there is no variation or shadow due to change. Of his own will he brought us forth by the word of truth, that we should be a kind of firstfruits of his creatures.
Frequently when sharing the gospel one will hear the statement, "How can God be a loving God if there is so much evil in the world. How can there be a God with so much pain and suffering?" These are the types of statements that James is addressing. Verses 16 and 17 tell us not to be deceived. God is not the author of pain, suffering, and evil. He bestows gifts on us that are good and perfect -- those gifts that are adequate, complete, and beneficial.
Evil, pain, and suffering are the results of sin. But God has "Of his own will brought us forth by the word of truth." This speaks of the regeneration of sinners. God's work gives us salvation. Nothing I can do or choose to do will give me favor with God. Only by the Word of Truth (the Bible) can I realize my need for God and accept the precious gift of His Son.