Everyone will have a different answer, so don't worry that there's one "right one" - you have to get the balance that feels right for your family.
For me I try to strike a balance between having a guess at the root cause of behaviour, but also having lines that aren't crossed.
For example, a 40 min tantrum might have been that he wasn't really hungry, or it was late, a long day and he was tired, if it was extra hot he might have been thirsty, he might not have had enough exercise/fresh air, you might be able to notice patterns more widely that can predict behaviour.
Mealtimes are quite easy, I take the approach that I provide food and they choose to eat it or not, there will be more food provided in roughly 2 hours (4-hourly meals plus snack) so they won't go hungry, and I just don't worry about it. As long as there aren't severe difficulties with food, normal toddler fussiness won't result in starvation, malnutrition etc.
DH is a bit more prone to worrying about their eating than me so he will coax them a bit more, sometimes feeding them, offering them distractions, alternative foods etc. Which is OK - I think it's fine for parents to take different approaches as long as they aren't directly contradicting each other.
In general I take the approach that I control the environment when they are toddlers, and so I don't expect them to "control" their behaviour as such, but they might get choices that I am genuinely OK with both options, and I think they learn self control from those boundaries too. For example, you can walk around or come and eat, but food stays on the table. Or, you can hold my hand or sit in the buggy, but we are by a road and I need you safe. Then the adult makes overarching decisions like: OK, you keep pulling away from my hand, and I don't feel safe, so I'm going to strap you into the buggy. Or this mealtime is just turning into a stressful time; you seem like you're not really hungry, I'm going to clear it away. I would (ideally!!) not get drawn into a back and forth tug of war over these - if they (probably at a more verbal age than 20m) say "Noooooo please I will eat/hold hands/whatever" and you give them another chance and they don't do it and you threaten to take it away again and it goes on and on - no - just unhelpful and will exhaust you, until you get to a place where you're parenting in a more reactive way (shouting, hitting etc). Make an executive decision and stick to it and then validate feelings or distract or sympathise or ignore or WHATEVER helps.
Something I have found is helpful is differentiating between boundaries and requests/commands - people often use the word "boundary" to mean "thing I don't want my child to do" but that isn't really a good definition, the better way to think of it I've found is that the boundary is something which is within MY control (as you can't control another person's behaviour, even a two year old) and about what I will or won't do.
So my boundary about food might be that it is only served at the table. I won't let you take it away from the table. (Hold the boundary by stopping child from getting down, asking for the food back, explaining that it stays on the table, taking the food out of their hand if necessary, bringing the child with food back to table if necessary, clearing away mealtime if child is not coming back). Also adults/older children can help model by keeping their own food at the table.
I also might have a boundary about what I serve for dinner. This is the food that's available, if you don't like it, I will make toast, or porridge, but I'm not making a whole other meal.
If I do not want my toddler pulling all of my books down, I move them to a higher shelf, and put toddler-friendly, more robust board books on the shelves that they can access. The extra height is a physical boundary.
Whereas a request/command is something like "Leave the bookshelf alone" or "Stop splashing water out of the bath" or "It's time to go now, come on follow me" especially if you then back this up with something like "If you do that again, you are coming out of the bath" or "If you don't come now, no pudding". and then wait for them to decide whether to do it again or not and then react with either praise for complying or whatever the threatened punishment/consequence was if they do not.
I think (controversial opinion alert) request/command backed up by threat is a totally useless strategy with toddlers, especially 2-3 year olds. It causes a lot of excess stress and conflict and frustration for parents, because you get into a lot of situations where you think "They KNOW the rule, they know they will get into trouble but they do it anyway". IME people who try to rely on this a lot have a very frustrating time and find the toddler years very draining. Interestingly they tend to report that it gets easier at around 4, which I think is about the usual time for when this strategy does work with a child's development. It's usually put down to the idea that 2/3 year olds are constantly pushing boundaries and by age 4 (ish) they have learned where the boundaries are thanks to you holding them, and they don't push back against them as much any more. I think this is a misconstrual of what boundaries mean, and is more about children developing a better sense of considering potential future consequences. They WILL push boundaries whatever you do, but it's much less frustrating IME if you're thinking of the boundary as something that's totally under your control, rather than the boundary being an invisible line that you're basically daring your child to cross and then you have to police it all the time.
Control environment, try to have half an eye on their physical needs (including stuff like overstimulation, temperature, hydration, need for movement/exercise, attention, etc), know what your boundaries are that you can control, steer them towards the wanted behaviour with positive reinforcement. If they are totally losing it, remove them from the situation. All of these are great strategies which work well and can reduce conflict in the toddler years. It's my favourite age. Enjoy!
(I love the How To Talk books too, there is one for "little kids" from age 2 ish).