Good info from the previous posters. When I was learning one obvious fact, that wasn't obvious to me, was that as your boat heels and your mainsail gets closer to horizontal it is actually catching less wind and makes it even harder to go all the way over. Until you get more familiar with how to control your sails during gusts, you can always make a quick turn towards the wind as you sort things out. That will instantly get you more "flat" and give you a chance to think through what you want to do with your sheets and or traveler so that you can resume your original course with more comfort/control. If the gusts are of short duration it may be over by the time you decide to return to your original heading and you can continue on without easing your mainsheet and then having to trim back in. That is my lazy method
when there is a cockpit full of guests that I don't want to crawl over to grab sheets.
Welcome to Sailnet and don't hesitate to ask for help. Happy Easter.