There are a number of ways to get to the Sognefjord. Probably the most enjoyable is via a ferry from nearby towns; the most convenient would be one of the high speed ferry services operated several times each day from Bergen.
It is also possible to reach the town of Flåm, which sits at the tip of a fjord that branches off the Sognefjord, via an incredibly steep railway line.
Of course, many of the towns on the fjord are also accessible by daily bus services.
Other points of interest
The Sognefjord is crossed by the second largest stretch of a powerline in the world. Its span width is 4597 metres ! Do not expect tall pylon at the end of this stretch. They are not required, because of the topography.