Here's a homebrew rule that I use as a DM. I'm sharing it because it makes my games more fun for me and the people I play with!
I'm not sharing this to tell you how to play your games. If this doesn't sound like your jam, that's okay! I hope it still gets you thinking about how you do play, and what makes the game fun for you.
The Pacifist Playthrough rule is pretty simple. In short, I commit, as the DM, to never force players to kill a sentient, reasoning creature. If the creature can be reasoned with, the players will always have the option to resolve conflict without violence.
Vitally, this rule doesn't involve denying your players the choice to fight and kill, if that's what feels right for them. The characters might decide it's the right choice, for any number of reasons. Instead, the Pacifist Playthrough rule means making sure they know they can always say "what if there's another way?" and you'll give them that opportunity.
Because combat encounters are part of the fun of D&D, when I use the Pacifist Playthrough rule I include encounters with all manner of less intelligent creatures, constructs, animated objects, and other creative options for things against which to do battle. A little creativity can go a long way toward giving your players reasons to roll initiative without leaving a body count.
The most low hanging fruit for this option is to discourage the classic "murder hobo" trope. Simply informing your players that violence isn't the only solution can help them explore other fun solutions, as well as novel concepts for their characters.
Beyond that, I developed this rule to fit the kind of stories I wanted to tell with my campaigns. I think classic Good vs Evil stories are great and fun, but they don't excite me as a DM. I'm more attracted to stories where people are messy and changeable, where relationships matter more than alignments and nothing's too black and white. Setting up expectations with my players from the beginning, by stating this rule plainly, helps foster an environment where complex relationships play into the campaign, diplomacy has power, and the players can feel their own agency in the story.