Start by making sure you have a complete railway loop laid down, with a depot included.
Then right-click to open the menu, press the button showing a locomotive with a wand, build whatever train you like, and finish by pressing the button with the green checkmark. Your new train will appear on the track.