The process of ordering food via vending machines in the restaurants is very common in Japan for two reasons. It improves the ordering process much more efficiently to make the work easier for the staffs and it is also safe against the bilks who maliciously run away without paying for the food.
1. Before putting money into the machine, choose and decide which item you would like to order from the menu. You may be able to find the pictures and the names of the food by the vending machine which would make it easier for you to decide. However, if you are still unable to identify which one is the one you are looking for, it is best to ask the staffs than just ordering something unexpected.
2. Put in money (cash only) and select what you want to eat. Preferably, take coins and smaller bills with you as some of the places do not accept larger bills like 10,000 yen. You should also keep in mind that the credit cards are not acceptable in any restaurants where they have vending machines.
3. You can buy more than one tickets without putting your change back in to the machine each time you press the item button. After you press the item that you want to have, keep in mind that the machine will not return your change right away as the vending machines in Japan are made conveniently for the users who want to have more than one items. So as long as you put in enough cash to cover the items, the machines will be able to keep printing the tickets without returning the change each time you press the button.
4. After you are done with selecting the items, do not just stand in front of the machine to wait for the change to come back. What you must do at the end is to press the "Otsuri (おつり)" button to get your change back. Otsuri (おつり) means change in Japanese. Most of the vending machines in Japan are written only in Japanese words and it may be difficult for you to find the button to get your money back, so make sure to press the Otsuri (おつり) button after ordering. The machines usually have the lever also to get your change back.
5. After you bought your tickets and got your change back, hand the tickets to one of the staffs. They will usually read the tickets out loud to inform other staffs what you have ordered.
6. Take the seats. Just sit back and wait until the food comes.