Psalm 11:4 says that God is in His holy temple on His throne in heaven discerning with His eyes and trying the sons of men. He tries the sons of men just as people put gold into the furnace to try it and purify it. The sufferings and trials of mankind are in God's sovereignty to try people. Psalm 11:4 says that His eyelids try the sons of men. When we are gazing at something, we are exercising our eyelids. God's gaze tries the sons of men.
In Psalm 18:6 the psalmist appreciated that God from His temple heard his cry in his distress. It is difficult to say whether the temple here refers to the residence of God in the heavens, or the physical temple on Mount Zion, His retreat place on earth. At any rate, this verse describes the initial, elementary, enjoyment of God related to His house.
The psalmist enjoyed God in His house, so he blessed others with his experience. He blessed others with God's sending them His help from His sanctuary and His strengthening from Zion (Psa. 20:2). The word Zion here refers to the temple in Jerusalem. When God came and stayed in His retreat place, the temple on Mount Zion, He sent help and strength to those who trusted in Him.
The psalmist as the one who enjoyed God in His temple, in His house, made a big mistake in understanding in Psalm 15:1-5 and Psalm 24:3-6. Both times he asked concerning who could be in God's holy sanctuary on His holy mountain. According to his concept, this one was the perfect man according to the law, who had clean hands and a pure heart. This is a wrong concept. This shows that David was like us in making mistakes.