When you get tired, your bike breaks down, you suffer from a strong head wind, or you are running out of time, there are several options to get to your destination by public transport.
It is allowed to take your bicycle in any train, except during the peak hours. You have to buy a special ticket for the bike. More information on the Dutch railways website.
Unfortunately, buses never carry bicycles. Don't despair, Holland is a small country, there is always a railway station nearby.
When cycling in Holland tou wille have to cross a river every now and then. As far as we know all ferries carry bicycles. There are even lots of special ferries for pedestrians and cyclists only. See also the separate page about boat and bike.