Did you build this computer yourself or did you buy it as a computer set from a retailer?
When it freezes during the POST, Check to see if your motherboard has any Trouble LED, Codes, or BEEPs showing. This can narrow down to what hardware is causing the problem.
It will be very helpful if you post your entire computer specs including the RAM part numbers, Make & Model of Motherboard, GPU, and PSU. Plus your current Windows version and AMD driver and BIOS Version installed.
The Ram part number and Motherboard is important to determine if the memory you have installed is compatible with your Ryzen CPU.
Is your BIOS in "Default" or did you make any changes to your BIOS settings? IF you changed any BIOS settings, do a clear CMOS (according to your Motherboard's Manual) to put the BIOS back to "Default".
If you are not sure of your computer specs download a small free program called SPECCY and upload images of your Motherboard, CPU and Memory after running the program.