If I write a contract, do I immediately receive payment for it from my broker? Or do I have to wait for someone to buy it ?
Well you don't "write a contract" unless someone is willing to buy it, but I think you mean "place an order to write". You get the premium when you sell the option, not when you place the order.
And secondly, if the stock hits the strike price, do I immediately sell my shares, or does that happen only when the person decides to exercise?
No - the strike price is the price at which the holder can buy the stock, they are not obligated to. Typically the holder of an option that hits the strike can make more by selling the option than by exercising it, so exercising before the expiry date, or "early exercise" is rare.
Since you're obviously new to options in general, here are some other tips:
- When you sell a covered call, your net profit is limited to the premium you get from the option (plus whatever gain you have already). You are essentially giving up any profit if the stock goes above the strike in exchange for the upfront premium. Your downside is not limited (technically your loss it's limited to the value of the option, but there's no protection above that).
- Look at the implied volatility of the option and compare it to options on other stocks. The higher the IV, the "more expensive" the option is. If you have a stock with a very low volatility, you won't get as much premium for your option, so you might look for strikes that have a high IV since that means you'll get more premium upfront (but also a higher risk of loss).
- Like any investment, don't put in any more than you're willing to lose. And set reasonable stop-losses (e.g. max 10% loss) in case your option position turns against you. It's better to bite the bullet on a learning experience that watch it continue to fall hoping there's some way to turn it around that you don't know about.