All the scripts and resources necessary for the IR Remote Youtube video https://www.youtube.com/watch?v=V8rmir-Tmy8
These examples require the IR Library for esp8266/esp32 found here https://github.com/crankyoldgit/IRremoteESP8266
Make sure you have the official libraries installed for each device from the official M5Stack github https://github.com/m5stack
Some theory about IR https://www.sbprojects.net/knowledge/ir/index.php