The correct answer is: B. Mandamus
Mandamus is a writ issued by a court to compel a public official to perform a legal duty. It is a powerful tool that can be used to ensure that government officials comply with the law.
Habeas corpus is a writ that orders a person to be brought before a court to determine whether they are being held lawfully. It is a fundamental right that protects individuals from being held in custody without due process of law.
Prohibition is a writ that orders a lower court to stop hearing a case. It is used to prevent a lower court from exceeding its jurisdiction or from making a decision that is contrary to the law.
Quo warranto is a writ that asks a court to determine whether someone has the right to hold a public office. It is used to challenge the authority of public officials and to ensure that only qualified people hold office.
In the case of a court finding that a particular office holder is not doing legal duty and thereby is infringing on the right of an individual, the court would issue a writ of mandamus. This writ would order the office holder to perform their legal duty or face consequences.