Plan your trip months ahead. Like virtually every form of travel, the prices are cheaper the further in advance you purchase your tickets. If you wait until the last second, there's a chance that the train could be filled to capacity. Plan a couple months ahead to give yourself an opportunity to get the best fares possible.
Figure out your exact route. Don't go to Europe without an exact plan of where you are going to go and on which dates. Especially if you are on a budget, you need to have it all planned out to make sure you have the necessary funds.
Go to Rail Europe's website where you can purchase the tickets you'll need for your train journey in Europe. If you are going to be traveling between multiple countries, consider the Eurail Global Pass which allows you to travel between 18 countries. You can also purchase One-Country Passes that allow you unlimited travel within one specific country.
Consider sleeping on the train or staying in hostels to save money on travel costs. Hotel bills can add up quite quickly in Europe.