The boatswain is the leader of the deck crew of a ship. Usually he worked himself up through the Sailor ranks and is the most experienced deckhand.
The bos'n is in charge of dividing the work on deck, he plans and hands out the different task to other sailors and supervises them. Also he is responsible keeping the stores related to deck maintenance.
The boatswain gets his orders directly from the Chief Officer whom will tell the bos'n what he wants to be done, or what he wants to have the most attention.
Depending on the experience and the nature of the Chief Officer, he can be given a great deal of freedom in planning and executing the maintenance on deck.
This maintenance includes the hull, deck houses, masts, mooring arrangements and rigging. Cleaning, greasing, painting, replacing of worn parts etc.
During cargo operations, the boatswain places the lashings and operates hatch covers.
On some ships with a bigger crew, a Boatswain's mate my be part of the crew to support the boats' in his job.
The boatsman is generally the person who operates the anchor winch when letting go or heaving up the anchor. Also will he operate the davit or crane that launches or recovers any of the ships (life)boat. In lifeboats he usually is one of the crew members with a dedicated spot, in the forward to handle any lines.
The bosun works the day watch and does not have nighttime look out or steering duties.