Welcome to the Community,
for ESXi hosts that are managed by vCenter Server, you have two option (depending on the license edition):
- Rest the root passwords via Host Profiles (https://kb.vmware.com/s/article/68079) - required Enterprise Plus
- Join the hosts to the AD domain, then login to the host using an AD user, and reset the root password (https://kb.vmware.com/s/article/2075361)
Which version of ESXi you're using ??
If you can run it, I recommend "Host profiles" solution proposed by a.p.
I got to test it in the production environment. With positive result.
I also made two articles in my blog about it (in Italian)