Help with button command on relay

Pin 2 is part of the boot sequence and will be HIGH when the ESP boots.

Are you using version 5.0 0 library or the master branch?

See Advanced Warning - next library update will send ESP pins low on bootup