Sultan Ahmed I was the ruler of the Ottoman Empire from 1603-1617. He was concerned about the constant warfare and civil unrest that occurred when a sultan died. The sons of the sultan would quarrel and inevitably, warfare would ensue.
Ahmed's curious solution to this problem was that he would no longer allow sons to become active in government. They were essentially prisoners in the palace until it was their time to govern. In this spirit, the future sultans would only learn to enjoy the extravagances of palace life and not learn the skills needed to run a massive empire. This policy would consistently produce completely incompetent rulers that could not possibly govern such a large empire. It also meant that the sultans would no longer lead their armies in battle, which produced an elite class of military men within the empire.
The lack of strong central leadership led to corruption and bribery in the government that further weakened the political system. The rise of an incompetent central government led to regional or local governments gaining more autonomy and authority. Different regions of the empire did not trust the sultan to protect their interests so they started to exert their own authority. This resulted in a stark decline in tax revenue to Istanbul. With less revenue, the government became more inept, and the military suffered as a result. This all happened over the course of two centuries and coincided with the rise of the European empires of England, France, Russia, and Austria.