Here is the article about programming with Arduino IDE
For Windows:
https://m5stack.readthedocs.io/en/latest/get-started/m5stack_core_get_started_Arduino_Windows.html
For MacOS:
https://m5stack.readthedocs.io/en/latest/get-started/m5stack_core_get_started_Arduino_MacOS.html
J