When approaching a pier for a landing under sail, the jib should be dropped some distance away, according to your judgement. This will slow the boat's speed but keep maneuverability. Lines and fenders should be ready to use, just as they would be for a landing under power.
You must have an idea of how far the boat will coast after the last sail is lowered or allowed to luff, and before the boat loses maneuverability. You can practice this in open water by heading the boat up into the wind and allowing the sails to luff, and observing how far she carries
her way. A lightweight, centerboard boat will stop in the water almost immediately, while a heavy keel boat travel for several boat lengths before stopping, depending on wind and sea conditions.
When the boat is judged to be the right distance from the dock, she is brought into the wind with the sheets freed, and sails luffing. The boat will coast in with maneuverability. The right distance will vary with each boat, and wind and sea conditions. Ideally, the boat will lose way and come to a stop of her own accord and within reach of the pier, and lines can be put ashore and the boat secured.
If the landing looks like its going to be bad, turn away from the pier, and get away and try making another approach. This does take some practice and you need to know your boat and how it acts under different conditions.