Applications can be found at the airport, and you need to complete the FMM form for Mexico before you get your turn at the FMM service counter. Once you do that, you hand it to the immigration officer, he or she will rip it in half and you will get one.