Hi
Install mqtt in the pi
https://www.instructables.com/id/Installing-MQTT-BrokerMosquitto-on-Raspberry-Pi/
Setup a Python app with a mqtt client on the pi
http://www.steves-internet-guide.com/into-mqtt-python-client/
Setup mqtt client on your M5Stick
https://github.com/m5stack/M5Cloud/tree/master/examples/MQTT
This should be a good start to get mqtt connected on the both devices.