Nationalism helped to weaken the Ottoman Empire at at least two separate points. The first point made the empire weaker while the second point helped to destroy it completely.
The first episode of nationalism came during the early 1800s. At this point, Ottoman territories in the Balkans rebelled against the empire. This rebellion included armed uprisings in Serbia and in Greece. The Greeks were actually able to win their independence through this rebellion. These rebellions did not topple the Ottoman Empire, but they did leave it weakened.
Nationalism came into play again in WWI. This time, the nationalist uprisings were mainly in the Arab parts of the empire. These uprisings (helped along by the efforts of the Allies) helped to make it more difficult for the Ottomans to participate effectively in the war. The loss in the war led to the complete destruction of the Ottoman Empire.