The Psalms use the language of being “cast down” and “brokenhearted,” and speak of God’s nearness to the sorrowful.
In Psalms 34:18:
18 The LORD is nigh unto them that are of a broken heart; and saveth such as be of a contrite spirit.
In Psalms 42:11:
11 Why art thou cast down, O my soul? and why art thou disquieted within me? hope thou in God: for I shall yet praise him, who is the health of my countenance, and my God.
In Psalms 147:3:
3 He healeth the broken in heart, and bindeth up their wounds.