Alain de Botton has a book called "Religion for Atheists". His central point is that religions have gone through hundreds or thousands of years of cultural evolution and likely contain rituals and rules that benefit us even if the religion literally isn't true. Discarding religions because we don't literally think there's a bearded guy in the clouds watching over us is throwing away the baby with the bathwater.
I'll have to check that out. It's something I (as an atheist) feel as well. There seem to be a number of religious practices which align quite nicely with mental health practices. The ones that immediately spring to mind are responsibility transfer (short-circuiting anxiety spirals by throwing faith into an imaginary party who says it will all be ok), and "gratitude" practices - practicing thankfulness for what you have, meeting quite nicely with the practice of saying grace before a meal.
At first glance it seems foolish for a poor family praising their god for the pittance of food in front of them, but the idea that pausing to be grateful for what little they do have may make them feel better mentally (regardless of the wider injustice of the situation) has merit.
It seems like the process could be - do a thing, see positive results (maybe from improved outlook), interpret it as gods reward for pleasing him, codfiy the practice.
Religion isn’t about believing in the bearded man in the sky. To me it is about developing a wiser and healthier mind. That includes understanding things which are at times hard to believe at first. But that mustn’t necessarily be whether there’s that man in the sky. It could also mean whether there’s actual other life in the universe, maybe even more intelligent life which eventually degraded into the bearded man due the lack of a wise, developed mind. Maybe.