When preparing to dock, what is the safest way to stop the forward motion of your boat?

When preparing to dock, what is the safest way to stop the forward motion of your boat?