The way I interpret it is dementors represent depression and the way to counter it is by the power of gratitude, being thankful for what you have, focusing on the small bits of happiness, alongside your therapy.