I think there's varying degrees depending on what your goal is. Besides VMs you could have a different user login for each compartment which means things like browser profiles, shell history and other things will get their own settings.
I record a lot of videos and wrote a little script[0] to help backup and restore my shell history to avoid auto-complete and CTRL + r searches from showing sensitive info (client work, etc.) while recording. I only use one browser for recording which has its own history too.
For my use case that's enough separation, for others it might not be. For example I still need to be careful about running commands like `docker image ls` on video because it has potential to show client work. I just remember to black out sensitive info during editing if it happens to come up.
With VMs or setting up different profiles?