Modern rifles have the advantage of bullets that can be easily loaded and unloaded. I can't image it's very easy to take out a musket ball and compacted gunpowder after it's been all rammed down. This shouldn't be an issue for a soldier going into battle expecting to use his musket. But for a sentry with a quiet shift or a group maintaining order in a colony, they probably aren't going to fire their rifle most of the time. So, did they carry loaded muskets while performing routine operations? If so, how were they unloaded? Also, how did this vary across nations or areas?
Actually it was pretty standard protocol for sentries to fire at a mark after their shift was over to unload their musket. They did it for safety, as well as to give men a little marksmanship practice. Obviously this would not be on the scale of mass marksmanship training, but it was fairly standard, at least in the US and British armies during the War for Independence and 1812.
If one needed to unload a musket without firing, or in case of a catastrophic misfire - wet powder or a mis-load or something* - there was a tool called a "worm" which could be hammered or drilled into the lead ball to pull it out. From there, standard cleaning with hot water and oil would be performed to clear the barrel.
*one of my favorite stories of a misload is from the Battle of Fallen Timbers in 1794. An over-eager young Shawnee warrior fired a single shot, and was in such a hurry to reload as the American forces were advancing that he dropped the ball down the barrel before the powder, and rendered his musket useless for the duration of the (very short) battle.
That warriors name was Tecumseh, who would become one of the symbols of Native resistance to the US during the War of 1812.
Redcoat by Richard Holmes and With Zeal and With Bayonets Only by Matthew Spring both cover sentry duty a bit, as well as slightly more info on general British marksmanship training during the War for Independence.
Bayonets in the Wilderness by Anthony Gaff and Tecumseh, A Life by John Sugden relate the story of Tecumseh's misfortune at Fallen Timbers.