An 1800X has 8 cores with SMT to better handle up to 16 threads, but most games will likely not utilize that many threads anytime soon. So in most games, some of its cores will be sitting there not doing much of anything. The 8600K has just 6 cores without SMT, however, relatively few of today's games make heavy use of more than 4 cores, so 6 should be enough to handle most games well for quite a while, at least so long as you're not live streaming. The 8600K does offer some more performance per core though, and at least in current games, that will likely be more beneficial to performance. As far as gaming performance goes, the 8600K would probably be the better option.
There are other CPUs worth considering as well though. In games, an overclocked Ryzen 1600/1600X with 6 cores and 12 threads should provide similar performance to the 1800X at a lower price, since again, the 1800X's additional cores won't typically be doing much. Or there's the second-generation Ryzens. A Ryzen 2600X or overclocked 2600 will provide slightly better gaming performance than the first-gen Ryzens, though they are still a little behind the 8600K in terms of performance in today's games. Or, on the Intel side, there's also the i5-8400, which has 6 cores like the 8600K, but is clocked a bit lower, and can't be overclocked. Performance in today's games should also be pretty good though, again, at a lower price. Note that overclocking the 8600K will also require a Z370 motherboard.