I would go Ryzen 5 2600 just for the upgrade path to a 16 core and you can even have some fun overclocking.
R5 2600 VS I5 9400f
R5 2600 pros:
Comes with a better cooler ( style, noise, and performance taken into consideration)
Overclockable on B450 boards that cost as little as $65ish
Has an upgrade path to 12 and 16 core CPUs.
Has a more stable framerate.
AMD will still release new CPUs you can upgrade to without a motherboard change, whereas the new Intel CPUs will not be able to work in the same motherboards as a 9400f.
i5 9400f pros:
Likely will have an easier chance working with fast ram above 3200mhz or so, although B and H series budget motherboards limit you to 2666mhz.
Slightly higher average framerate, but due to its lack of hyperthreading it can stutter in demanding games where the 2600 may not suffer.
Has upgrade available to the I9 9900k, which is about the best gaming CPU to date.