Always approach a dock slowly and in control of your speed. To get a smooth landing, approach the dock from the downwind side, landing with your bow as close to the wind as possible. Have your docklines tied on and coiled and a fender ready to place where needed.
The safest approach is from a close-hauled to a close-reaching course. Luff your sails to slow down. If you need more speed, simply trim your sails back in, get the speed you need, and then let the sails luff again. If you're coming in too fast, circle around to try again. You can also brake your speed by backing the main. Don't try to stop a rapid approach by sticking out an arm or leg. Use a fender to cushion the blow if you can't circle around.
When you must approach from the upwind side of a dock, don't try to land with your sails up. You won't be able to slow down enough for a safe landing. Position your boat directly upwind of the dock, and lower the mainsail. Approach the dock slowly using the jib; luff it when necessary to slow, and drop it shortly before docking. Let the wind slowly push you to the dock.