Gas sensor with ESP-01 can't connect to WIFI

The ESP-01 is power hungry.
You need it to be connected to its own 3.3V power supply; not the Arduino's.
Otherwise, it won't work reliably.

Once you have that.
You need to manually use Putty or some sort of terminal program to communicated with the ESP-01 to make sure you have the AT commands right and you are able to get onto your router.

Once that it done, put those AT commands into your Arduino sketch.

If you hadn't started the project, I would have suggested that you buy a ESP8266 module such as the Wemo D1 mini pro or something like that, and save yourself a lot of headache.

.