Can i use a Virtual Machine for a development environment?

Hey guys i’m new to this sub i needed to know if using a VM is good enough for a development environment or do you really need WSL2 or ubuntu/windows Dual-Boot i don’t want to do it since i’m afraid i may mess up so what would you suggest? Would you say using a VM is better as a beginner and then move to Wsl2 or dual boot idk guys pls help me out in this one, thanks in advance

Edit: I use a laptop that has intel core i7 it has 16 gb of ram and i have about 500 gb free of space (also have nvidia geforce rtx 3060 as gpu if it’s needed) so would performance be a issue with vm, if is not i wanted to learn to use things on a vm first then go for wsl, but let me know

Edit again : thx for all the answers guys much appreciated i will try it out myself first and let y’all know about it but thanks again for all of your time