No, never a full 40 days with zero food. I’d be careful about trying that without medical supervision.
What I did was a 40-day Lent fast: no social media and one simple meal a day (see this). I was irritable and kept grabbing my phone out of pure muscle memory.
Fast from the apps that eat your time, not the phone itself. I deleted Instagram and TikTok, turned off every notification except texts and calls, and moved my Bible app into the spot where Instagram used to sit on my home screen. You can still submit assignments and text your mom, but you’re not doom-scrolling at 1am.
Around day ten I started praying in the moments I used to fill with scrolling, like waiting in line at the drugstore or waiting for class to start.
Jesus fasted in the wilderness right before starting his ministry. That was preparation for something specific, so keep that in mind before trying to copy the 40 days exactly.