Summary:

You can simply order one of your units to attack another civ's units. If you're not currently at war with the civ you're attacking, a pop-up will appear asking if you want to declare war on that civ (or city-state); if you choose to do so, the attack occurs. If you decline, the attack is aborted.