How run ch4 gas sensor code in esphome?

I saw GitHub - DirkHeinke/arduinoToESPHome-guide: Guide to convert arduino code to ESPHome component with inputs controlled by Home Assistant.
But there is no sensor and external libraries, can’t implement it.

Can someone make an example of how to implement arduino code with external libraries and sensors in esphome
I believe that then many people would have much less questions, it seems that this Arduino code question comes up again and again…

can someone help to get this code to work in esphome