On Java Edition, you would put the Item/Object with Mending in your off-hand to restore the Durability of it while farming mobs. Sadly, Bedrock Edition does not have the off-hand mechanics like Java Edition (you can only use a Map, Shield and Totem) so you can't do it "the easy way".
What is the most effective way to restore durability with Mending? I have tried to use my Sword on the first slot and the tool on the second slot to quickly switch before grabbing the XP orbs, but this is a bit tedious and is not guaranteed to work.