How do a replace an old baseboard thermostat with a wifi thermostat?
Get a different 'stat

The thermostat you have is designed for low voltage (24VAC) systems such as gas furnaces and heat pumps.  You'll need a line voltage thermostat instead (and yes, wifi line voltage 'stats are a thing.)