Do what? If it's just installing a new custom ROM, what I would do is:
* back up my apps and data (e.g. using Titanium Backup)
* download the ROM .zip and copy it to my SD card
* boot into recovery
* take a backup of the current system and data (always a sensible precaution)
* do a factory reset (if moving to a different ROM, or if it's a major version update)
* install the new ROM from the zip
* Reboot phone, restore my data from the backup
That assumes you have a custom recovery, but if you are S-Off I expect you've done that too.
If you want to install and official update but have a custom recovery, if you have not modified the ROM in any way and can find a copy of the official recovery corresponding to your software version then you can fastboot flash that then install the update. But there's no point being S-Off and not rooted, so I asssume you'd need to reflash the whole thing to stock. So for that you have to find a RUU that's compatible with your phone (depends on the "customer id" and software version), back your data up (because a RUU will wipe the device), run the RUU (windows executable), then restore your data, wait to be notified of the update, then let it install. As I say, I personally think the custom ROM way is less hassle.
I might add that while I'm familiar with HTC in general, I don't own an M8, so don't have direct experience of that device.