Of the five writs available under Article 199, three account for most constitutional petitions filed in practice. The distinction between them is functional, not a matter of preference.
Mandamus
Mandamus directs a public functionary to perform a duty it is legally obliged to perform but has failed or refused to perform. It compels action, and is the writ most often sought where an authority is simply sitting on an application or request.
Certiorari
Certiorari quashes an order or decision already made without lawful authority or in excess of jurisdiction. It looks backward at a decision already taken, rather than compelling a future action.
Prohibition
Prohibition restrains an authority or tribunal from proceeding further where it is acting, or is about to act, beyond its jurisdiction. It looks forward, stopping something before it is completed, which is the key distinction from certiorari.
Choosing the right one
Whether the authority has acted (certiorari), is refusing to act (mandamus), or is in the process of exceeding its jurisdiction (prohibition) determines which writ fits. A petition can, in appropriate cases, seek more than one in the alternative.
What to do next
Establish exactly what stage the authority’s action is at — not yet acted, acted wrongly, or currently acting — since this alone identifies the right writ.