Since Opal is the fifth Pokemon Gym Leader found in both Pokemon Sword & Shield, she simply won't be an easy defeat. Like a number of the Gym Leaders before her, all of Opal's Pokemon will be fully evolved. If that's not difficult enough, she will also bring four Pokemon into battle, something only the Gym Leader directly before her has had up until this point in your journey.
Thankfully, like all Gym Leaders, Opal can be much more manageable to defeat should you make smart decisions before leading up to battling her. One thing you can do is receive the Gift Pokemon Toxel from the trainer in the Pokemon Daycare on Route 5 and train it during your adventure. Toxel will evolve into Toxtricity, which is a part Poison Type Pokemon. Opal's Fairy Type Pokemon, outside of Mawile, are extremely weak to Poison Type Attacks.
On top of this, Opal will ask you questions during your battle. If you get the questions correct, your Pokemon will receive Stat Boosts. This will be extremely helpful during the battle, and they could be the deciding factors in a close win with Opal. To get all the questions correct, just remember that some people refer to Opal as the Wizard and that her favorite color is Purple. Also, even though she's elderly, she loves people thinking she is much younger than she truly is.
But should you not want to travel with that Gift Toxel or answer Opal's questions correctly, like all Pokemon Gyms you don't actually have to in order to defeat her. Opal's four Pokemon will all be below Level 40, so one could, honestly, train all of their Pokemon to Level 40 or Level 45 and still defeat her. This is incredibly simple to do if you battle all the trainers throughout your journey and participate in plenty of Max Raid Battles back in the Wild Area (and stock up on EXP Candy when you do).
Click Here To Learn How To Easily Defeat Gym Leader Gordie In Pokemon Sword! Click Here To Learn How To Easily Defeat Gym Leader Melony In Pokemon Shield!
We have questions and answers related to this topic which may also help you: