I presume we are talking Milan Malpensa airport (Milan has 3 airports, but Malpensa is the only one with flights to North America).
You would take a Regional train (called Malpensa Express) from Malpensa Airport to Milano Centrale station, then a train from Milano Centrale to Levanto. Some trains from Milano C. To Levanto require no changes, others (depending on the time of departure) may require a change (for example at Genova (Genoa).
Check your options here:
www.trenitalia.com
Enter from: MALPENSA AEROPORTO T1
to: LEVANTO
You can buy tickets at the Malpensa station when you arrive. I wouldn’t pre purchase tickets online because you don’t know if your flight will land on time.