I used to sell covered calls on a long term position I was in. One month there was a large upswing in the stock and my options were exercised.
I regularly sell covered calls and covered puts to generate some additional income.
While mostly those options expire worthless, I have had a few instances were they were exercised.
Here's my take on that: Whenever selling options, consider what value you put on the underlying security (there's a huge risk when there's no underlying security, such as VIX options). If your sell covered calls at slightly above what you consider full value, you cannot lose (as long as you bought the underlying below full value). Yes, it might swing to the upside above that, but there could be many unexpected drivers for that, and the same can go the other way. AFAIK no one ever lost money making a small profit
If you think that the underlying has huge potential upside, sell covered options only on a portion of your position, not too far out on the calendar, and maybe a little further out of the money.
The inverse goes for covered puts. If you believe a security is fairly priced, and you might jump in at a bargain price, you can sell a put (covered by cash or margin). First thing you did is collect a premium, if the strike price is hit, you get exercised at a price you believe is below fair value. If it's never hit, you walk away with the small income that the premium gave you (which is probably more than you would earn on the cash sitting in the account, and you actually earn that too!).
A recent example of how I sold puts, is that I sold June $10 EWJ puts. Since we are close to expiration and EWJ is way above, this is likely to expire and I pocket the entire premium. If EWJ drops below $10, I get exercised, but I am happy with that, as I believe EWJ at $10 is very good value.
Obviously this only works if you keep transaction costs low.