i dont know what i did to my ryzen 5600x but it is not running more than 4ghz even udner stress tests and i want it to be at 4.5-4.6ghz when it is almost at full utilization like when im playing games but be low ghz when im watching youtube videos or something like that. Does anyone know how to do this?
What you're asking for isn't the way Ryzen works and setting a fixed clock, as overclocking does, means it will always be at the high clock you want when gaming for everything.
But gaming isn't really stressful for modern multi-core CPU's especially Ryzen which will boost individual cores as needed for light bursty threads which is exactly what games need. A 5600 should boost to 4.6Ghz (many higher) in most games. But if not boosting above 4Ghz you may have it set up incorrectly.
What changes have you made in BIOS? If you've made a lot of BIOS changes and don't know what you've done you might just reset CMOS...or load default settings (find it in BIOS). Then start fresh.
I'd leave voltage and core clocks in AUTO. Many people reduce voltage in an attempt to stop temperature spikes and that kills boosting and performance. Instead adjust fans to ignore the spikes as they're really very low energy.
Be sure to install the AMD chipset drivers and get them from the AMD support website to be sure they're the latest. Also check for motherboard BIOS updates.
If you've installed any additional motherboard utilities they may be hurting performance too so you might remove them or quit them when gaming.
And last is cooling...the bundled cooler works well enough but it can get loud. If you've turned it down too much it can limit boosting. You have to adjust the profile to let the fan kick up speed above 70C or so. Upgrading to a big cooler pays off while quietly holding higher clocks under load and above 70C.
If case cooling is insufficient then the GPU's hot air while gaming is being used to heat up the CPU. So make sure you have good case ventilation.