Nationalism helped some countries come together. However, it also tore older states apart.
Empires and kingdoms were often made up of different ethnic groups. Some groups started thinking of times past, when they ruled themselves or had their own empires. They wanted to be their own nations again. Seeing others break away from outside rulers inspired groups to act on those feelings of nationalism and form their own nation-states.
For example, many different groups of people lived on the Balkan Peninsula. The Balkans are in eastern and southeastern Europe. In the early 1800s, the Ottoman Empire ruled most of that area. Nationalism helped push many groups to want independence. One early bid for freedom came from the Greeks, who started fighting the Ottomans in 1821.