Summary:

You may declare war on a civilization through the Diplomacy panel (see that section). You may declare war on a city-state by clicking on the city-state's city and picking "Declare War" from the pop-up.