Try to eliminate your nearest neighbours.
They are the civs most likely to declare war on you even if you don’t war with them. If for example you are on a continents map, secure your entire landmass if possible. Waging war for longer can result in a long lasting peace.
To minimise warmongering penalties, declare war in the ancient era. In classical times, denounce your enemy 5 turns before you war. That way you can use Casus Belli to declare a formal war.
Later in the game you’ll have the opportunity to declare war using other Casus Belli. Found a religion, make an alliance or forge ahead in technology or culture in order to invoke these. These Casus Belli significantly reduce the penalties.
Sumeria can make defence pacts with an ally and face no warmonger penalties if either party is declared on. Very useful in the late game!
Razing Cities & Peace Agreements
Unlike Civ V razing cities in Civ VI can incur severe penalties. However keeping more cities requires more luxuries. (See next section). So preferably raze a city if it incurs NO penalty (often the last city of a civ). But if it has a resource you require, or if it is in a very strategic location or if you’ll incur war monger penalties if you raze it, chose instead to keep it.
Should you capture settlers during war (and you should aim to do so) keep them and only settle once you are at peace. In fact if you can capture a foreign settler before it settles a city, you bypass a whole heap of warmongering penalties, not to mention benefit from healthier growth and production.
If you can’t eliminate the civ and you must make peace, make sure the cities you captured are ceded to you in your peace agreement. O/w should you not require the city and must better terms of a peace agreement, return it to negate war mongering penalties for capturing it.
Luxuries, Entertainment & Wonders
To mitigate your civilization’s war weariness give them more luxuries. The taller your empire the more luxuries you will need. The more cities you have the more copies of luxuries you will need.
Build the entertainment district and buildings.
The Aztec has bonuses to both of the above ways to keep your empire happy while you wage a lengthy war. Brazil also has a unique entertainment district, the Carnival.
Lastly and not the least, you can also build wonders to provide amenities to counteract war weariness. The Colosseum, Maracana Stadium to name two.
There are also policies and religious beliefs that may improve amenities depending on your situation. And there are a couple of policies in the late game that reduce war weariness.
The more casualties you have the more war weary your people become. So try to return wounded units to heal in your territory. Even if you can churn out a ton of them, you want to avoid casualties if at all possible.
Conversely if you decimate an opponents army it will incur huge war weariness on them. I’ve seen opponents get barraged by a barbarian uprising in cities I’m sieging. In such situations bide by the saying “the enemy of my enemy is my friend”.
Finally, using nuclear devices incurs the most severe of all penalties.