Jesus did it.
Buddha did it.
Mohammed did it.
Moses did it on Mount Sinai.
They all took to the desert or some wild place, and practised discipline of the flesh for the magical duration of 40 days, spending that time on some austerity (tapas) with the purpose of purification.
While Jesus was tempted by the devil, Buddha had to withstand the taunts of Mara.
After these trials, all began their public ministries.
There is a period of fasting in the Hindu tradition called the Mandal Kal ~ this is also 40 days.
Zoroastrians practise the Chalisa or 40 day Ritual ~ it is a time of special devotion to the Divine in order to maintain the connection.
Sikhs practice the 40 Days Of Prayer.
Various researches have found 40 days is the time required to break a habit and reinforce a new neural pattern in the brain.
”Whatever you do, whatever you eat, whatever you offer as oblation to the sacred fire, whatever charity you give, whatever austerity you perform, do all that as an offering unto Me”
~ Bhagavad Gita
”Feel your suffering, rest with it, embrace it, make love with it. Feel your suffering so deeply and thoroughly that you penetrate it, and realize its fearful foundation. Almost everything you do, you do because you are afraid to die. And yet dying is exactly what you are doing, from the moment you are born. Two hours of absorption in a good Super Bowl telecast may distract you temporarily, but the fact remains. You were born as a sacrifice. And you can either participate in the sacrifice, dissolving in the giving of your gift, or you can resist it, which is your suffering.”
~ David Deida
“Penance performed out of foolishness, with self-torture or to destroy or injure others, is said to be in the mode of ignorance.”
~ Bhagavad Gita
”Your pain is the breaking of the shell which encloses your understanding.”
~ Kahlil Gibran
”You give but little when you give of your possessions. It is when you give of yourself that you truly give.”