The practice of memorizing the Doxai and other exercises of ancient Epicureans seems to parallel a certain human, religious behavior, cross-culturally that I equate (to an extent) with something like a Catholic rosary, and the memorization of certain prayers (even the "Serenity" prayer in AA), the idea behind it being employing remembrance of truths to overcome temporary obstacles.
I heavily used that when my wife was faced with death two years ago.
Not the rosary, of course. But when someone you love is dying, and you have done everything you can to solve the problem, the problem-solving facet of the human mind keeps on working, and you keep on believing there is a solution, and that naturally leads our minds to begin searching for answers beyond the logistically-possible, and the empirically-probable. The mind reaches for an ultimate, reality-overcoming answer that will change the conditions of mortality, and solve everything. I think it there is a tendency to explore the possibility of divine intervention.
Here's how Epicurean wisdom helped me in that situation: it removed fear.
Magical thinking feeds fear. It is also a crutch. If I held that agreement (between me, and the superstitious idea in my mind), it would have been me assigning human agency to an idea that would be incapable of any sort of intervention. I would be holding an idea in my head for the most important responsibilities in our lives, caring for our health and the health of our friends. That idea fails us, because ideas don't cure sepsis, antibiotics do. God doesn't cure the sick, MDs do. Mysticism doesn't reinforce physical health, practical decisions do. And when magical thinking becomes tantalizing because it offers a solution (albeit fake) for the fear of death, the teachings of Epicurus address that exact same fear, but don't rely on the crutch of magical thinking.
Truly, Epicurus saves us from the fear that comes from a collapse into superstitious thinking.
Some people feel that ... ugh, what did George H. W. Bush say ... "There are no atheists in foxholes", implying that everyone, when faced with death, has a "coming to Jesus" moment. A family member of mine suffered the death of one of their best friends, and that incident persuaded them, after many years, to go back to church and find peace. And they did. And they (believe that they) found peace. I believe it is just a bandaid. It doesn't actually cure us of fearing death. It's just a comfy narrative to deal with the overwhelming, existential fear that we all face. I felt that same fear, and that same, strong desire to put my faith in "Everything happening for a reason", beyond the realm of scientific understanding. At that time (and those times, previously) I go out of my way to practice everything I know to be true: materialism, hedonism, empiricism: reject superstition.
At the end of the day, those things reinforce true confidence, not just a spiritual bandaid.