While staying in the Ryzen 5 5000 series, I would say to just get the Ryzen 5 5600X. I just built a PC for my cousin, and he loves it. I don't see a reason to go with anything more than or less than the performance the 5600X provides as the AM4 platform is now obsolete. What I mean is, there will be no more CPUs on that platform to my knowledge.
AM5 just released, and if you have the money for it I would say to just adopt the new platform, because AMD has committed to using it for a minimum of 3 years.
However, on the AM4 platform the best gaming chip is the 5800X3D. It outperforms everything released for AM4, and nearly meets the performance of the Ryzen 7000 series in most games.
This all being said, games are getting more demanding. Every major release has been more and more demanding and the Ryzen 5600X seems to hold it's own in almost every game my cousin has played since I built his PC.
I do not know if you are going to be using the PC for more CPU intensive tasks but as a gaming chip the Ryzen 5 5600X is neck and neck with my Ryzen 7 5700X. The budget option Ryzen 5 5600 is also a great choice as it isn't much of a downgrade from the Ryzen 5 5600X. I purchased the 5600X just because it was on sale and came with a cooler.
One thing you can do is go on YouTube and search Ryzen 7 1800X vs Ryzen 5 5600X and see if there are any comparisons.
Ryzen 7 7700X, MSI MAG X670E Tomahawk Wifi, Corsair DOMINATOR® TITANIUM RGB 2x16GB DDR5 DRAM 6000MT/s CL30, Sapphire Pulse AMD Radeon RX 7900 XTX, Corsair HX Series™ HX1000, Corsair MP600 PRO NH 4TB