Your MacBook Air M3 has experienced two freezes when waking from sleep since updating to macOS 26.6.2.
On both occasions, the screen was black with a spinning rainbow cursor, and you had to force a shutdown.
The timing makes the macOS update worth considering as one possible factor, but two occurrences are not enough to establish that it caused the problem.
First, check System Settings >> General >> Software Update and install any newer macOS update that is available.
For troubleshooting, you can also temporarily disconnect external monitors, docks, USB devices, and other peripherals before putting the Mac to sleep.
If the problem stops occurring, that would provide a useful clue.
You can also test the Mac in Safe Mode.
Shut it down( do not use Restart ) , hold the power button until “Loading startup options” appears, select the startup disk, hold Shift, and choose Continue in Safe Mode. Test several sleep/wake cycles. Whether the problem occurs in Safe Mode or not can provide useful diagnostic information.
If the freeze happens again, after restarting check System Settings >> Privacy & Security >> Analytics & Improvements >> Analytics Data for reports created around the time of the incident.
Reports containing terms such as panic, WindowServer, kernel, or watchdog may be particularly useful.
You can also run Apple Diagnostics by shutting down, holding the power button until the startup options appear, and pressing Command-D.
At this stage, there is not enough information to conclude that you need to erase the Mac or reinstall macOS.
If the problem happens again, the diagnostic report would be particularly useful for determining what was happening when the freeze occurred.