Trains are perhaps the most comfortable and safest method of intercity transport. The express (skorostnoy, or ‘high-speed’) trains between Tashkent, Samarkand and Bukhara (and from Khiva as of 2018), with airplane-style seating, are faster than a shared taxi and a lot more comfortable. Book at least a couple of days in advance, and preferably longer, as they are popular. These have economy, business and VIP classes, though there's not much between them.
Other long-haul trains are of the slow but comfortable Soviet variety, with platskartny (hard sleeper) and kupeyny (soft sleeper) compartments available. Some long-distance trains offer deluxe ‘SV’ class (private compartment) seating.
Slow, dirt-cheap local prigorodny trains, with bench-style seating, are worth avoiding as they take twice as long as a shared taxi.
You can buy tickets for any Uzbek train service at any train station; you will need your passport and you pay in som. Only locals can buy train tickets online, but this service should eventually extend to tourists. For schedules visit www.uzrailpass.uz; the Russian version works better than the English version.
Some tour agencies can book train tickets in advance for you (45 days in advance is the maximum), which can be useful during high season, though you can expect to end up paying two or three times the actual ticket price for this service.
Tickets can be particularly hard to obtain in September when students return to Tashkent from the cotton harvest.