Let's take an example and say I have 1000 shares of NVDA and I want to hedge it before the earning. For simplicity, NVDA price is 130.
In this case, I would buy 10 contract of NVDA 125 put for $5 each, and sell 3 contract of NVDA 130 call for $7.5 each, all options expire at the same day
In this hedge trade, the premium from covered call will cover roughly half of the cost of the put premium, effectively lower the cost of hedge by half. The put protects almost the entirety of my postion on the downside if NVDA earning not good. If NVDA earning is good, it essentially means to profit on 1/3 of position at 130, but still let the remaining 2/3 to ride the uptrend. For risky trade, you can even buy additional NVDA shares afterhours after earning is out, so that the covered call will only "call out" the new shares and you keep the original shares without paying tax (of course, this has risk if NVDA goes other direction if you mis-read the earning report)
This is just an example, but you can tweak the strategy such as buying put spread instead of put to further lower the pemiums cost, or to mix the ratio of call and put (for example, 1:4 instead of 1:3, etc).
On the actual execution, you want to always buy put first, and wait later in the day to sell call. If stock immediately goes down after you buy put, you already make profit on that put. If stock continues going up after you buy puts, you can get more premium on the covered call later that day.
Hope this helps