It's really hard to look up and realize that you aren't being the parent you always hoped you would be. I'm pretty sure we've all been there, and it isn't easy. It's especially difficult to break out of habits like yelling that are hard-wired in you because it was the way you were raised.
Are you a big reader? Several titles jumped into my mind as I was reading your post that could be helpful. How to Talk so Kids Will Listen and How to Listen so Kids Will Talk is a great one. You mentioned that you have to threaten in order to get her to listen - it may be that you have created a situation where she knows you aren't serious the first time you say something, so she knows she can wait until you do mean it. When you say something the first time, make sure she really hears you - don't call over your shoulder while you're doing dishes and she's playing with a toy. Go to her, get on her level, make eye contact, and get confirmation from her that she understood you - then wait expectantly.
I second the recommendation to incorporate more direct play with her. Playful Parenting is a great book explaining why we need to play with kids in their world. Play is how kids connect, and the more connected the two of you are, the more harmonious your relationship will be, the more she will WANT to listen and comply.
I'd also say to pick your battles wisely, but when you do decide on a boundary, keep it firmly and calmly. In your example, to me, asking for a yogurt before being finished with a granola bar is not a battle I would fight. You can always save uneaten food for later. If it becomes a boundary-testing game - asking for yogurt, getting yogurt, no longer wanting yogurt and wanting toast instead, then not wanting toast, wanting soup instead - THAT is a boundary I would set, calmly refusing to get more food. What I think is sometimes, maybe most times, is going on with that boundary seeking behavior is not that they're looking to be controlled, it's that they are looking to feel secure. They want to know that you have control of the ship, because if you do, then they are safe. If you don't, they are not. You can empathetically set the boundary, without yelling and without punishing. "I'm sorry you are so upset. You may eat any of these things I've already gotten for you, but I am not getting anything else." The most important thing is to stay calm. Take a break if you need to, but stay calm.
Also, try to re-wire your perspective of a situation - so, she wants a yogurt, you say no, she says, "Fine I'll get it myself." Superficially, my goodness, that is infuriating! It can feel like a real slap in the face. Try to think of it as a positive thing that she is so independent, that she is willful. It will serve her well later on. While we would all probably love to have children who are blindly obedient and just say, "Yes, mama" all the time, do you really want to raise an obedient adult? Or do you want an independent, self-sufficient, bold adult? Unconditional Parenting is a great book to help you keep the long view in mind.
Best of luck!