There have been numerous posts by people running 24.10.X on Ryzen CPUs specifically complaining about “random reboots when idle”, a key symptom of an older Ryzen power issue.
When going idle CPU/Motherboard incorrectly communicates to the PSU to lower the provided level of power too far. The issue occurs when the power drops so low that the CPU can’t wake up again.
Update the BIOS and set Power Supply Idle Control to Typical. This is the best option.
If you can’t update the BIOS, try just disabling C6-states.
There’s a fair chance the above will resolve some of the crashes.
Having said that, running memtest and such like the others have suggested, is also a great universal tip, especially due to the kernel panics.