First, make sure you have the terrain cleared of any blocks that would prevent you from laying down track. If you're unsure of how much space you'll need to clear, use F5 while holding a piece of track. This will allow you to preview the track in the world before you place it. For example, in the following picture you can see that the Red Wool will prevent the placement of the track.
Then simply right-click the ground where you want the piece of track to start from. From there you can continue building track by placing them end to end.
If you shift-right-click the ground with track, you'll instead place a preview track into the world. Use these to help plan out longer sections of track before having to commit to it. To get rid of them, use a Prybar to shift-right-click the preview track's master block(visible by showing hitboxes with F3 + B).
Metre Turn tracks allow you to make curves, but to connect them, you'll have to place the track from the other side.
Metre Turn tracks will also allow you to travel diagonally across the map. After the initial 30/60/90 Metre Turn track, use Diagonal Track before adding another Metre Turn track to go back to regular tracks.
If you want your lines to branch off into different tracks, there are several switch tracks available for your use.
To actually change the direction of the switch track, you'll need to place Switchstands. They'll need to be placed right next to where the metal rod on the switch track is. 30 Metre Switch tracks, for example, need to be placed on the side of the track 2 blocks in as seen in the image below(all other switch tracks have their Switchstands placed 3 blocks in).
Also take note that compared to Metre Turn/Switch Tracks that are meant to take large curves, Parallel Lanes/Switches allow traffic to swiftly transition into tracks parallel to the former.
With that, you're ready to build your very own railway. Just don't forget to add Buffer Stops at the ends of your tracks. We wouldn't want any accidents would we?