I devote my life to my little one, which is how it should be. However I can't get past why I'm having difficulty some times.
I would guess it's this. Where have you got this idea from, that you "should" devote your life to your LO? Devotion is a very extreme word, and IME this is just a recipe for exactly what you're experiencing - where you are putting everything into making your toddler happy, which BTW is a futile endeavour, because children will never be happy 100% of the time and it wouldn't be healthy if they were - but also, this approach to parenthood, putting 100% into your child, leaves nothing left over for you. And that means you're running on empty a lot of the time which makes it really difficult to maintain patience for the moments where your child is acting as children do.
Two things to change - if you're currently under the illusion that it's your job to keep your toddler happy all the time, drop that immediately because it's impossible and not actually good for them anyway - they need to learn to navigate all of life's feelings, not just the nice ones. Something I've observed is that parents who feel responsible for their children's emotions tend to feel panicky or upset or guilty when their child experiences a moment of frustration or upset (because they think they are failing) - that could be why you're snapping at him, because you're feeling like "This is impossible! I'm already doing SO much, give me a break!!"
Separate his understandable upset (at being tired and having been taken around a busy supermarket and then stuck in a car in a traffic jam) from your job as a parent - it's OK if he's grumpy after all that, after all you probably feel grumpy too! And you'll take it less personally and feel less personally attacked by the fact he is whining or not being cooperative. That means you can deal with it a bit more sympathetically.
The second thing is to move him down a peg from being your highest priority. Obviously a 2yo does need to be a priority because they can't do much for themselves. But the functioning of the family as a whole is the highest priority. That means there is a balance between what you need and want, and what he needs and wants. He doesn't need to be right at the top in order for you to meet his needs adequately or even well. But your needs probably need to be higher - at the moment I would guess they are somewhere near the bottom of the pile. That doesn't work, and will eventually lead to burnout.
Do you like podcasts? I find the Motherkind podcast really good and it goes through a lot of these themes regularly.