The upright shall dwell in Your (God’s) presence. Psalm 140:13, and when we are in God’s presence, there is joy (Psalm 16:11), and there is safety (Psalm 91:1) in God’s presence.
What takes us out of God’s presence?
“He who works deceit shall not dwell within my house; He who tells lies shall not continue in my presence..’ Psalm 101:7
“Do not be hasty to go from his presence. Do not take your stand for an evil thing, for he does whatever pleases him.” Ecc 8:3