To extend the IR range on an M5Stack, the best approach is to use a high-power IR LED paired with a transistor or MOSFET driver to safely handle higher current. Adding a lens or collimator can also help focus the beam for much greater distance and accuracy, and ensuring the signal is properly modulated (like 38 kHz) will improve compatibility with most IR receivers. Just make sure your power supply can support the increased draw from stronger hardware. If you share your budget and required range, I can suggest specific components.