The whole day is a preparation for sleep. But what one does shortly before sleep can also have a special effect. Repentance, seeking forgiveness from God for our sins, asking forgiveness from those we have sinned against, or resolving to do so, and forgiving those who have sinned against us, are all ways of purifying our hearts before sleep. We put ourselves at peace with God and man.

Yitzhak Buxbaum in Jewish Spiritual Practices