I'd like to say this is as easy as inserting a CD, and running the interactive installation/upgrade. However, there are some prerequisites to this.
The first one is to ensure that your hardware is supported, and whether it requires additional drivers, which are not included in the installation image.
It's also a good time to check/upgrade the host's firmware at that point.
If the hardware is supported, download the appropriate ESXi ISO image, or offline bundle, and run the upgrade. Major hardware vendors offer customized images/bundles which include hardware specific drivers, and tools, so make sure you select the right one.
If you want to run the upgrade from the host's command line, upload the offline bundle (.zip file) to a folder on a datastore, then shut down all VMs, put the host into maintenance mode, enable SSH on the host, and use e.g. putty to connect to it.
Once logged in as root, find out the profile name from the offline bundle ...
esxcli software sources profile list -d /vmfs/volumes/datastore/folder/offline-bundle.zip
.. and run the upgrade command.
esxcli software profile install -d /vmfs/volumes/datastore/folder/offline-bundle.zip -p <profilename> --ok-to-remove --dry-run
If you have individual drivers installed, consider to replace "install" with "update" in the command line.
Note:--dry-run may be used to evaluate what's going to happen without actually changing anything. To run the upgrad, omit --dry-run.