If you're an employee, you can get similar results changing up your job every year or two. Maybe slightly longer if you really like the place.
Even in the "recession" recruiters are knocking on my door fairly regularly, and I'm comfortable enough with the Leetcode circus to be able to pass an interview loop. I'm sure some people will vehemently disagree but I notice a clear difference between my peers that only have experience working at 1 or 2 places, and those with experience working at 5-10 different places with different cultures, stacks, etc. It's obvious that the former are in a bit of a bubble and get blindsided in hard times or when there is a big technology shift.