You will use more vending machines in a week in Japan than in the rest of your life combined, so it is worth two minutes to learn the system. Most of it is intuitive. A few parts are traps.
Red is hot, blue is cold
The price label under each drink is color coded: blue with つめたい means cold, red with あたたかい means hot. The same machine serves both. From around October until spring, entire rows flip to red, and canned corn soup, milk tea, and hot coffee become the best 130 yen hand warmer in the world. First-timer mistake: buying a hot lemon tea in August because you did not look at the label color.
Money, in order of usefulness
Coins from 10 to 500 yen always work. 1,000 yen notes almost always work, and the machine gives change. 5,000 and 10,000 yen notes almost never work, so break them at a konbini first. In cities, the tap pad takes Suica, PASMO, ICOCA and friends, which is the fastest way to buy anything in Japan. Some new machines like JR East's acure units even sell by app. The retro machines and rural oddities are coins only, forever. Carry 100 yen coins like they are ammunition.
Reading the machine
A red 売切 lamp means sold out. A blinking button means it is deciding your change situation, not broken. If the machine has a screen, it probably takes cashless and probably speaks English if you poke it. If it has hand-painted labels, you are somewhere good.
Frozen machines are a different sport
The post-2020 boom put restaurant food in freezer machines everywhere: ramen, gyoza, whole cakes. What drops is rock solid and often needs a microwave, so these are for taking home, not eating on the curb. Exceptions exist: hot ramen robots like Yokai Express cook the bowl for you in about 90 seconds, and cake in a can comes with a tiny spoon because Sapporo thinks of everything.
The etiquette part
Japan has almost no public trash cans, but machines usually have a bottle and can bin standing next to them. The move: drink it there, bin it there, walk away clean. Do not walk the street sipping and definitely do not leave your can on top of the machine. Machines with custom queues, like the Label Fruits latte machine, work like tiny shops: order, wait for your name, step aside.
Now go find the weird ones
Everything above covers the normal machines. The abnormal ones, the dashi bottles with whole fish inside and the wagyu gacha and the temple burgers, follow the same rules with more ceremony. They are all on the map, sorted by city, with field notes on exactly how each one works.