last reboot
and last shutdown
will give system history for those two commands. log show —predicate ‘eventMessage contains “Previous shutdown cause”’ —last 1h —info
will return some (mostly documented) codes indicating whether the Mac was shutdown or restarted normally.
Is there any means to collect from a macOS Sonoma device the last time it was booted into Safe Mode?