I think it's important that if they have both misbehaved that they are both punished. Otherwise you'll have the older one thinking that the younger one can get away with anything and resenting it.
Time out works quite well with both those ages, particularly with the "he's breathing at me"/ "she looked at me funny" whinges.
I'm sorry to say that you've got a number of years of that - my dc are grown up and even now on the odd occasion you can get the "they're taking up all my space..." etc. Although I tend to laugh at them and join in now.
Distraction can work. Get them doing something together - clear the table or similar. Even a 2yo can put spoons on the table in the right place, or wipe a mark off the wall (baby wipes work brilliantly for that).
Praise them both for times they are being nice to each other, and working together. Praise the older one for doing things the younger can't - and point out times when they are doing something fun that the younger can't do.
Try and give them one-to-one time if possible.
It is a mixture of jealousy, attention seeking, and simply just being on top of each other - which sounds silly, but they are always there and so they're irritating.
Boredom doesn't help, nor does hunger. I used to find the whinges were at their worst just before they ate. Give them something to eat/piece of fruit (frozen peas were a favourite for mine) and see if it helps, sometimes even while you're getting the meal ready it can be worth it. Two of mine (strangely not the biggest eater) used to be really effected by hunger.
Let them have space. Don't expect them always to share. If dh pinches my favourite cushion I feel put out (he says they're all the same, but they're not!) so let them have some things that are theirs and they only have to share if they want to.
We found having their own place rather than just sit where you want helped. That was something that evolved, rather than a choice, but it meant that they knew where they were so weren't put out to find someone else sitting where they wanted to sit.
And don't feel guilty if you resort to screen time to give yourself a break. It's like any other method - great when you're in control. We didn't have a TV and they were born too long ago for phones/tablets when mine were that age, but I used to find that putting a DVD on and giving them a bowl of popcorn (we had a popcorn maker) could give me half an hour of peace, and if they'd been at each others' throats, then often that was enough to calm them down and when they'd finished would get on with something else.
It sounds (written down like this) much easier than the reality at the time, so be kind to yourself. There were times they were gorgeous and times they drove me to distraction. Now adults, the lovely outweighs the rest by a long way. It doesn't always feel that way at that age.
Dm once bought herself a cap that read "Peacekeeper" because she said that's what being a Mum felt like. We were very put out because, (each of us thought) you know it wasn't me, it was just my siblings are deliberately annoying. But she was right. 🤣