Go to a train station or office. These are located in almost all the major cities and towns in Ukraine.
Present your passport and ask for tickets to your destination. Remember, it is not possible to reserve tickets, only to purchase them if you are already in Ukraine.
Provide the following information: Your destination, date you are departing, number of passengers and return ticket information if needed.
Tell the ticket agent what class you prefer. Discover Ukraine has an excellent, detailed description of each class. First class compartments have two bunks and a locking door, and sometimes even a TV. Second class has four bunks with a locking door. Make sure to say whether you want a top or bottom bunk. Third class has six bunks in an unlocked compartment. First and second class are about the same, but third class will be louder and more crowded.
Pay for your ticket in cash.
Have your passport, method of payment and shipping address ready.
Pick a company and visit its website. European Rail (http://www.europeanrail.com/) can help you book trains traveling from Western Europe to Eastern Europe. Real Russia (http://realrussia.co.uk/) can help you book trains leaving from within the Commonwealth of Independent States to Western Europe. Some other Ukrainian travel agencies for travel within Ukraine: http://www.ukraineconnections.co.uk, http://www.tourkiev.com/ and http://www.ukraine.co.uk/.
Follow the instructions on each website.