This is the principle behind behavioral activation, opposite action, and cognitive behavioral therapy, three of the most powerful therapies for depression.
Links here: https://open.substack.com/pub/astralcodexten/p/singing-the-blues?r=1r8dq&utm_medium=ios&utm_campaign=post