Unless you are on an ocean passage and in the middle of the ocean, you should always be able to anchor quickly.
It is, after all, possible that you can simultaneously lose both your engine and your ability to sail. I had something like this happen once in my last boat when I was in Buzzard's Bay. I had left that morning from Newport bound for Mattapoisett. As often happens, the Southwesterly freshened and I was on a run - under mainsail alone. Shortly after I was SE of New Bedford, there was an accidental jibe. The mainsheet and traveller on the Great Dane 28 are on top of the binnacle - which also had the engine controls. (the boat was steered by tiller, though). Well, the jibe literally ripped the binnacle off!!! What was left of the binnacle was hanging from the mainsheet - partially in the water below the boom alee. There was no way I could use the engine but I was able to attach the mainsheet to a stern cleat and thereby able to jury-rig the main. Then, I proceeded to Mattapoisett and managed to pick-up a mooring under jury rig! I can tell you I exhaled deeply (whew!) after I secured the mooring pennant.
On another occasion, I lost power when headed from Castine towards Belfast. So I made sail (it was a very light wind so we just ghosted along) and eventually anchored in Belfast. (That was less dramatic).
Another time (all of these happened with the Great Dane) I was just about to enter Hogs Neck Channel when, all of a sudden, the revs on the engine decreased sharply to the point where the boat lost steerage. I discoved that the throttle cable had loosened and quickly placed some vice-grips on the throttle in the binnacle (where it terminated) to hold it up and with that jury rig was able to make it into Onset. As I was getting ready to anchor I removed the vice-grips and the boat lost weigh and I was then able to anchor. (Whew!)
Another time I was just about in the channel getting ready to leave Threemile Harbor when SMOKE started billowing out of the companionway!!! I immediately turned off the engine and turned the boat sharply to port and anchored among the nearby moored boats. (THAT had my heart racing!). I noticed that the smoke was much less. Upon inspection I saw that a hose clamp holding the hose to the exhaust muffler had come undone (hence the reason for the smoke; there had never been a fire). So I resecured the hose with the hose clamp and headed out the harbor where I arrived at my original intended destination, Sag Harbor. (Nothing like smoke to scare the $%&^ out of you!)
None of the above was made easier by virtue of my sailing the boat singlehanded (although, at least I didn't have a crew member freaking-out next to me).
Sometimes you just have to think on your feet. An ability to stay cool - and logically approach a matter - in a crisis is essential. It also really helps if you have already given thought to various crisis scenarios. Contingency seamanship is a must.
Jerry