The Ottoman empire is one of the few empires to last into the twentieth century. The only other empire of note to accomplish this feat was the British. The Ottoman Empire's gradual decline is the result of economic, militaristic and political factors.
The empire had been at a disadvantage since the sixteenth century when it fell behind in technology and trade. The European nations developed superior weaponry and had broad export markets unlike the Turks. Another liability of the Ottoman Turks was their highly decentralized government. Each section of the empire had its own leader with his own sub-government. As exemplified by Muhammad Ali's successful rebellion, these sub-leaders had too much power for the central government to act effectively.
The empire failed to adapt to the times. Not only was its military outdated, the brutal autocratic regime stood in stark contrast to the democratic governments and the rights afforded to citizens of France, Britain and Poland. The constitution of 1876 was a step in the right direction, but real reforms were not permanently implemented until the empire dissolved and the Republic of Turkey was formed. Support from its own citizens is a very necessary factor in the survival of an empire, something which the Ottoman empire severely lacked near its demise. With its harsh suppression of autonomy movements and other restrictions, the government behaved like the doomed Communist empires.