In Windows there is a concept of creating a "disk image" for recovery, where one creates a complete copy of the operating system drive so that if the operating system doesn't work, the disk image can be reloaded into the computer, effectively bringing the computer to the state it was when the image was created. This is done with a rescue CD or flash drive - the flash drive is connected, the computer is started up, thereby booting from this drive, and the software on the drive can then reload the disk image from an HDD or wherever that image is located.
I'm looking for the same functionality in a Mac but can't find it, perhaps because I'm using the wrong term for it. I'm new to the Mac world, and the term "disk image" seems to mean something different in that world.
So how do I get this recovery functionality (-recover to a previous state from a completely unusable operating system) with a Mac?