Hi Molly, great question!
For me, finding confidence in those situations came with time and experience - the more I felt I knew about a topic, the most likely I was to ask questions if I didn't understand some part of it. It can be difficult as a minority, because you probably already feel like you don't belong in the space and that people think less of you, so asking a question or asserting an opinion seems risky - like you'll be confirming a negative bias. Try your best to push past that though, and with time it gets much easier!
I also want to echo Adrian in saying that you need to build up a support system! I'm part of a great group of female engineers at work, and whenever one of us has a concern (am I being assigned only the busy-work? am I being overlooked for a promotion? am I being constantly interrupted in meetings?) we discuss it together and figure out a plan to fix it (talk to a manager, HR, etc).
Confidence in yourself is important, but confidence alone won't make you successful due to the biases that work against women in engineering - this article does a great job explaining why: https://www.theatlantic.com/family/archive/2018/09/women-workplace-confidence-gap/570772/ .
Good luck! We need more women in engineering, so stick with it!