The Ari (Rabbi Yitzchok Luria) used to teach his group in Safad to practice Tikkun Chatzot, the nightly midnight sessions.
These were mainly devoted to the recitation of Lamentations and the confession of sin, followed by hymns of praise and hours of joyful study of Torah and Kabbalah.
The rationale is that when one thinks of the Exile of the Shechinah, we invoke a feeling of loss and abandonment.
When this does not have the desired effect because it is too abstract, then one must think about the exile of the Shechinah in oneself.
Then a person can experience the sorrow and the heartbreak of his life.
And afterwards, he can more easily come around to the joy of prayer and study.
So that sadness at fixed times can be a way of release from routine dullness and an opening for light and inner happiness.
–Rabbi Adin Steinsaltz
From The Long Shorter Way by Rabbi Adin Steinsaltz