Your dog used to watch the window. Now they bark at the window, at the doorbell, at a bin bag on the pavement, at a dog 3 streets away. It built up over a few weeks and it feels like a different dog.
Why barking shows up now
Two things change at the same time. Your dog's world got bigger, so more of it seems worth commenting on. And responsiveness to the cues of the person who raised them drops around the onset of adolescence, then returns later in the stage.
Barking also pays. A bark at the window is followed, every single time, by the thing outside going away. Nothing you say can compete with a reward that reliable, which is why the answer starts with the window rather than with the bark.
Name which of the 4 barks you have
These need different answers, and treating them as one problem is usually why nothing has worked yet.
Alert barking at the window or the door. Short bursts, aimed at something your dog can see or hear, and it stops when the thing leaves.
Frustration barking on the leash or behind a gate. Aimed at something your dog wants to reach, and it gets faster and higher the longer they cannot reach it.
Demand barking at you. Aimed at your face, your hands or your dinner, and it stops the moment you give in.
Barking with your dog alone in the house. This one is not a barking problem, and it belongs with alone time instead.
Tonight, 10 minutes, the window
You cannot train a dog out of a view. You can change the view, and that does more in one evening than a month of asking for quiet.
Cover the lower half of the window your dog uses most. Frosted film, a blind at half height, or the sofa moved 3 feet back so they cannot get up to the glass.
Put a chew or a stuffed toy in the room where you want your dog to settle. Do that for the hour when the street outside is busiest.
For 5 minutes, sit near the changed window and feed 1 treat every few seconds while nothing happens. You are paying for quiet before there is anything to bark at.
When your dog does bark
Answer on the first or second bark, not the tenth. Go to your dog, look at what they are looking at, and say one calm word.
Then feed 3 treats on the floor away from the window, so the sequence ends with your dog's head down and their feet moving away.
Do not shout over the barking. From your dog's side it sounds like you joined in, and it makes the next round louder.
Safety note
Some barking needs a person who can see your dog. Stop here if the barking comes with a stiff body, a hard stare, a growl or a lunge. The same applies if it started suddenly, over days rather than weeks. Sudden behaviour change warrants a veterinary examination, and pain often shows up as a change in behaviour rather than as a limp.
Why not a bark collar
A citronella or shock bark collar punishes the noise and leaves the reason in place. A review of aversive training methods found them associated with worse welfare outcomes and no training advantage. Dogs trained with aversive methods showed more stress-related behaviour than dogs trained with rewards. Reward-based methods are what the veterinary behaviour guidance recommends.
How long this takes
Alert barking at a changed window often improves within about 2 weeks, because you removed the trigger instead of arguing with it. Frustration barking on the leash takes longer and needs its own practice. Nobody can promise you a quiet dog, and the people who do are selling a collar.
Tonight's version, in one line: half the window covered, and 1 treat every few seconds through 5 minutes of nothing happening.