According to Locke, what happens when government does not uphold the social contract between the people and the government?

According to Locke, when government does not uphold the social contract between the people and the government, the people have the right to dissolve or overthrow that government. Locke argues that the primary purpose of government is to protect the natural rights of life, liberty, and property. If a government fails to fulfill this duty and instead violates the rights of its citizens or exceeds its rightful authority, the people are justified in rebelling against it. Locke believes that the power of the government is derived from the consent of the governed, and if the government fails to uphold its end of the social contract, the people have the right to establish a new government that better protects their rights and liberties.