All you have to do is register your credit and debit cards with the Dining Rewards Network via your choice of airline and whenever you dine at any of the participating restaurants and pay with your registered cards you automatically earn air miles (usually between 2 - 5 miles per dollar spent). You don't have to do anything at the restaurant, it's all automatic, and there's no cost to join.
You can go with the most lucrative earning strategy of choosing restaurants to dine at that participate, or just be surprised when you earn miles from unplanned dining!
Check out the Dining Rewards Network here: https://www.rewardsnetwork.com/earn/
Check out restaurants that participate here: http://stnd.rewardsnetwork.com/
These are the airlines that participate so choose the one you want to earn points with the most, create an account and register your cards! You do need an existing frequent flyer account with the airline you choose.
Alaska https://mileageplan.rewardsnetwork.com/
American https://www.aadvantagedining.com/
Delta https://www.skymilesdining.com/
Jet Blue https://truebluedining.com/
Southwest https://www.rapidrewardsdining.com/
Spirit https://www.freespiritdining.com/
United https://dining.mileageplus.com/
Note: You can have multiple accounts e.g. a Southwest one, a United one and American one BUT you can't register the same credit/debit card with them. Each card can only be linked to one dining account.
When you first sign up, you're usually offered a bonus (1,000 bonus miles or similar), if you complete a dine within 30 days. It's well worth it.
This is definitely the easiest way to earn air miles!