I've struggled with this before my self, where I would run a disastrous session and feel like shit about it for a while after. It happens to all of us, it's not a personal shortcoming- We all make mistakes, and your friends aren't mad at you, and they understand you.
Quick 2 bonus tips:
If you're the GM, try to get the players in your games to be GMs as well. Either invite people to your game who have experience GMing, or encourage your players to try running a oneshot. They'll become better players for it, and understand better what it's like to be behind the GM's screen.
Shortly after every session, write down what went well and what went poorly. Put it away for 1-5 days (before your next session) and then reflect on it.