VSphere Fault Tolerance will do what you describe, it creates an exact in step mirror that takes over if the 'live' ESXi host fails.
Anything that happens on the Live box happens on the mirror, so this is no protection against a crash, reboot, etc - It's only protection against the underlying ESXI box failing.
You need to have the appropriate licensing: Standard or Enterprise for up to 2 CPU's, Enterprise Plus for up to 4 CPU's. A 10Gb network between the two hosts is highly recommended, as is shared storage though if you're using VSAN this will work too.
Needless to say it's quite a list of requirements and is massive overkill in nearly all circumstances and HA is generally good enough.