Lot's of good advice in the responses, for subjects at different distances from the camera it comes down to either stopping down for greater Depth of Field or combining two or more sharp images in post processing. But for an image like this,
@Butlerkid (Karen's) advice is on the money, if you could have moved your position just a bit to the right so that both birds were the same distance or much closer to the same distance from the camera you could have captured both of them sharp with a single image.
There's lot's of situations where just a bit of photographer movement, up down, left or right can make an image work that might not work from where you initially see your subjects. That's not always possible and the wildlife may not stick around for you to move around like that but recognizing situations where a bit of position change can make things work is really helpful in wildlife photography not just in terms of in-focus subjects but also backgrounds, lighting, etc.