Verses in question:
1 Timothy 6: “The King of kings, Lord of Lords dwelling in the light which no man can approach.”
James 1:17: “He’s “the Father of lights” and on and on we see God is light. There’s no darkness in him at all.”
1 Kings 8: “Then spake Solomon: “The Lord said that he would dwell in the thick darkness.”
1 Samuel 22: “He made darkness pavilions round about Him, dark waters and thick clouds of the sky.”
Psalm 18:11: “He made darkness his secret place.”
The Bible uses the terms “light” and “darkness” in several ways and in a variety of contexts. For example, God’s dwelling place in heaven is filled with “unapproachable light” (1 Timothy 6:16), because his glory illuminates it (Revelation 21:23). God made light during creation (Genesis 1:5), Jesus’ transfiguration event manifested brilliant light (Matthew 17:2). The psalmist referred to light as divine instruction (119:130), and to those who “walk about in darkness” (82:5). In John we see light rendered symbolically (1 John 1:5), as well as refers to Jesus as “the Light” (1:4-9; 8:12; 9:5; 12:34-36,46). In Matthew Jesus spoke of his disciples as “the light of the world” (5:14-16).
This is missed by skeptics as they don’t differentiate between the usage of “light” and “darkness” in the Bible. For instance, one atheist juxtaposed the usage of light in James 1:17 (regarding God being the Creator (“Father”) of lights) against the poetic statement found in Psalm 18:11 (“He made darkness his secret place”). However, God being the “Father of lights” (James 1:17) has nothing to do on whether he dwells in darkness or light. In essence, what God has created and where God dwells are two different things. Thus, it is like comparing apples and oranges.
In 1 Kings 8:12 “The Lord said that he would dwell in thick darkness.” This is not discussing God’s dwelling place in heaven but instead, along with 2 Chronicles (5:13-14), his dwelling place in the temple in Jerusalem. In Psalm 18 and 1 Samuel 22 pictures God, not on his throne in heaven, but as one who “came down” from heaven (Psalm 18:9), “flew upon the wings of the wind” (18:10), and delivered his servant David from his enemies while making “darkness His secret place” and “His canopy…dark waters” (18:11).
Does the Bible paint a contradictory picture of God? No, context is key.