Every dog needs a leader. If a dog doesn't have a leader, or doesn't believe they have a leader, they will instinctively take over that leadership role. Just about all behavioural problems stem from the dog not believing they have an appropriate leader.
The dog depends on a leader to survive. The dog leader keeps the dog safe. The dog leader ensures the pack gets fed. The dog leader ensures there is order in the pack.
Humans are the only species that can take over the role of leader in a dog pack. If you do not assume appropriate leadership behaviour, what we view as undesirable behaviours will result. Some of these behaviours are mild. Some of these behaviours are very serious.
This means, we need to act like the leader.
And being a leader doesn't mean violence. Successful dog leadership results from you being a kind and benevolent leader. However, you still need to be a leader, as opposed to a lackey.
Your dog will be happier, less anxious, and more of a joy to live with when you are the appropriate, and kind leader that you need to be.
And being a great dog leader is far easier than being a great people leader, as dogs are not complex beings.
Importantly, the dog needs to elect you as the leader by his/her own free will. And that's the key.
Let us know more about your leadership style and skills!