A dog that barks at you for things has been taught to, by you, and I say that without any judgement because it is almost impossible to avoid.
The mechanism is simple. The dog barks. You are busy, or embarrassed, or it is easier than arguing, so eventually you throw the ball or open the door. The dog has learned that barking works. Worse, if you hold out for a while and then give in, you have taught it that persistent barking works, which is far harder to shift than the original.
The fix has two halves and both are needed. The barking stops producing the result, consistently, by everyone in the house. And a different behavior starts producing it: sitting quietly, going to a mat, a nose touch, whatever you prefer. Removing the old route without offering a new one leaves a frustrated dog that tries louder.
Be ready for it to get worse first. When a behavior that always worked suddenly stops working, most dogs escalate before they give up, and that is the point at which people conclude it is not working and give in, which teaches the dog that a bigger tantrum is the answer. Knowing that spike is coming is most of getting through it.