easy peasy!
approach the rail, hop on to it, both feet at the same time, keeping your weight over your front foot, focus and look at the very end of the rail as you are sliding along it... then turn your feet down the hill as you come off the end...
Job done!
practice and patience, then it just comes naturally... like most stuff in life
If you skate or snowboard or surf think about which foot you lead with.. ie a regular/goofy stance, lead with that foot first on the rail; you should find that easier , then when you get confident with that foot leading swap it around..
works a treat!