Virtual machines are great, they allow you to mess around and learn about a computer without fear of breaking your main system or needing the budget to buy more hardware.
A virtual machine is just that, a virtualized or software driven version of a machine (computer). With today's computers being as powerful as they are, it is quite easy for the hardware to run the equivalent of multiple operating systems on a single laptop.
There are almost as many reasons to use a virtual machine as their are reasons to use a computer at all but some of the most common use cases range from learning a new operating system to security and malware research.
The easiest way to get started with virtualization and virtual machines is to download virtualization software such as VirtualBox or VMware. VirtualBox and VMware are examples of system virtual machines, they virtualize an entire computer operating system, not just a single program. This means you can run a Linux distribution inside of your Windows computer to try it out before switching, or run a Windows virtual machine inside a Linux computer to use Windows specific programs.
Note: Not all programs like to be run in virtual machines, most games for example will run an anti-cheat program to check for things like if the game is being run in a virtual machine to prevent cheaters in the game. If you plan to virtualize a program, make sure it is one which is compatible and that you do not break any EULA terms by doing so.