So you have ten days (nine nights?) total for Italy, and you wish to spend 5-6 nights in the Cinque Terre and the remaining 4 in Venice? Or do you have more time than that and other places you want to visit?
I'd work backwards. What time is your flight out of Milan home? If it's before noon, you'll probably want to spend the last night in or near Milan. Otherwise, if your flight home is late enough in the afternoon that you can start elsewhere, I'd probably end the trip in Venice and take an early train to Milano Centrale (and from there the Malpensa Express train to the airport).
That means you'd take a long train (with connections) a few days prior from the Cinque Terre to Venice.
And then you'd start with a train from Milan (Malpensa Express to Milano Centrale, from there a train to the Cinque Terre).
Questions: which town in the Cinque Terre? They are all nice in their own way.
I might suggest only three nights in the Cinque Terre and another 2-3 in another riviera town like Camogli or Santa Margherita Ligure, both lovely towns to the north of the Cinque Terre, which is very touristy in season, whereas to the north it will be a bit quieter and give you a different perspective.
Use the website www.trainline.eu to look at train tickets for both Italian operators (Trenitalia and Italo) or go to their individual websites to book tickets. If you care about saving money, book them (except regional trains) a few few months in advance...except for the first train from Milan, because it's hard to time the layover between landing in Milan and taking a train out, because you could be late and miss the train (and your tickets become worthless). Many find it better to buy their tickets last-minute as soon they land so won't have to worry about missing a train if they are late.