A Temporary Resident Visa is the most common visa for anyone planning to stay in Mexico for durations longer than six months, but less than four years.
You will need proof of employment. You will need to apply for the visa before arriving in Mexico. And once arriving in Mexico you will need to visit the nearest immigration office within 30 days to get your Temporary Resident Permit.
Another option is a Permanent Resident Visa, popular with retiring expats.
I would reconfirm the above with a visa specialist.