The most comfortable way to go to Sapa from Hanoi is to take the trains. There are buses leaving several times a day from "My Dinh" bus station, buses also pick up tourists from the hotels in the Old Quarter. If you like adventures you can rent a motorbike and drive up to Sapa, a beautiful 10h drive.
Most of the tourists who visit Sapa, travel from Hanoi to Lao Cai by night train, leaving in the evening from Hanoi and arriving at Lao Cai train station in the early morning.
To meet tourist demands, independent companies run their own services with upgraded carriages. These carriages are clean, comfortable, fully meet tourist standards with air-conditioners and soft berths. The national Vietnamese railway company also has good soft-sleeper tickets.
You can get cheaper train tickets at Hanoi train station and the more pricey one's from hotels and travel agents in the Old Quarter.