Japanese train ticket is unusual in the world, that it is neither QR codes, nor IC coins, but a paper ticket.
First, buy a paper ticket by JPY cash.
This vending machine (upper) is for local trains; you look at the fare for your destination shown on the wall, pay in cash, and a paper ticket will come out.
Larger stations have vending machines like this one (upper) where you can buy tickets for the Shinkansen Super Express and Limited Express trains. Some of them also accept credit cards.
In Japan, people often use transportation cards equipped with IC chips to , so regular tickets are made of paper.
When boarding, you insert your ticket into the automated ticket gate's paper ticket slot (see the next photo), replace the ticket that comes out, when you arrive to exit insert it into the same slot .
Be careful, Japan's automated ticket gates are complicated and about half of them don't have slots for paper tickets.
(CAUTION) This automated ticket gate does NOT have a slot for PAPER TICKETS.
In that case, please use the NEXT automatic ticket checker always set up next it.
Have a nice trip.