If all diplomacy has failed and peaceful union is no longer possible, you need to move your units in order to stop the conflict with military means.
Most attacks occur automatically: If your army crosses paths with an hostile army, or when its way passes the city in a hostile province, battles will begin. Attack calculations in a fight happen every hour (faster on speed maps), so a fight may take multiple hours to resolve. If your army wins the fight, the remaining troops will execute the previously given command and commence moving into the original direction. Artillery also has an auto-bombardment feature: Idle long-range weapons will start firing at the closest enemy. You can also specify the target by giving an attack command.
Even infantry, same as all other units, have a small range, which is usually not displayed on the map. Thus it can happen that your army starts fighting before it reaches its target. In this case the fight will be finished before the army commences its way to the target.
In some cases more than one country starts an attack on a single enemy province. Should an ally of yours win the province before you do, your units will will cancel their attack. You can also specify if your army shall only attack the guarding army or the entire city by dragging it onto the respective target.
Units which are stationed inside a city usually only use their defensive damage values, while units which are attacking a city usually only use their offensive damage values. Units fighting in the open field usually use both offensive and defensive damage values. You can see these different damage values in the unit details panel.
When your troops are on their way through a particular nation, they will cause war when they meet troops of the nation they are walking through. This happens when their status to your country is either "war", "trade embargo", "ceasefire" or "peace". To walk through other countries peacefully you have to retrieve at least "Right of Way" or "Shared Map". Crossing paths with foreign troops on international territory (sea) does not trigger wars, even without "Right of Way".