The Trinity is the source of all joy, it follows that nearness to him correlates to our experience of joy. If you read through the storyline of Scripture with an eye to the theme of joy there is a discernible pattern that will emerge—joy and celebration are consistently experienced in the presence of God.
The symbol of God’s presence in the Old Testament was the tabernacle and temple. In the stories where the tabernacle and temple are built there is great joy. We see this in every tabernacle/temple building or re-building narrative.
The book of Psalms, likely the book with the most references to joy, is focused on the the worship of God in the temple. The destruction of the temple is the occasion for the book Lamentations, clearly showing that sorrow is directly connected to distance from God’s presence.
This theme carries through to the New Testament where Jesus tabernacles among us (Jn 1:14). We become the temple of the Holy Spirit. And we await the time when the entire earth will become his temple. Every time God takes up residence with his people joy is the response. The Psalmist could not be more clear: “In Your Presence is fullness of joy” (Ps 16:11).
Circumstances do not dictate joy, presence does. You see, for the Christian there are two constants in life: pain and presence. We live in a world wracked by the curse and faltering under the weight of sin. It is our reality and it causes us great sorrow in our souls.
Yet, we who have trusted in Jesus Christ have the Holy Spirit residing in us and the promise that God will never leave us, which means he is always Immanuel. He is God with us! His presence is connected to joy, hence the possibility of rejoicing in the midst of sorrow. It is his presence that enables us to know joy in impossible situations.