I recently purchased a Ryzen 7 5800X with an X570 mobo. The system has been randomly freezing when not using any heavy processing. While playing a game or running benchmark/burn-in software, or video format conversions. No problem. It never froze. I did a BIOS upgrade. Same problem. Did some more reading and found reports that earlier Ryzens had issues with core parking and would sometimes freeze the system.
I did some more reading and found ParkControl that can control core C-states.
Among the settings, I found one that disables global C-state control. This forced all cores to remain at C0. There was also a setting to keep one thread of each core active with minimal random processing. I also enabled that.
Since then I have had no problems at all.