One of the best pieces of safety advice I ever received was this: when in doubt, don't ride.
There's no hard and fast rule, but it basically comes down to this: if you don't have your head focused on what you're doing, you're not in a position to maximise your own safety. For some that will mean don't ride with a headache. For others (for most of us in fact), don't jump on the bike if you've just had a fight with your partner or your boss. If you suffer from mental health struggles like depression, you need to evaluate whether your brain is in the game.
I was reminded of this while mucking around with a SMIDSY compilation video. There are one of two incidents in this that are genuinely frightening, and I'm scared to think what might have happened if the rider hadn't been on the ball.
The less obvious upshot of this is that you need a backup plan. Especially if like me you're a dedicated motorcycle commuter, you need to already have a plan for what you will do if you wake up on the wrong side of bed and determine that you really shouldn't bring that attitude onto the roads. I'm lucky enough to have a good mate who lives nearby who drives in to the city for work, so on those times when I haven't been fit to ride in, he has been good enough to give me a lift.
If you're not that lucky, then work out what your options are in advance. Instead of riding all the way to work, can you ride to a train station? Can you take a taxi or a bus? It's worth the time to work out your backup plan - it could save your life.