Both a former prosecutor & public defender
The governor appoints justices from a list submitted by a judicial nominating commission. Each seat on the court has its own district and nominating commission, and the chief judgeship has its own statewide nominating commission. Each commission consists of nine members: four lawyers selected by the state bar association, four governor-appointed nonlawyers, and a justice who does not vote. To remain on the court, newly appointed justices face a retention election during the first general election that takes place after they have been on the court for three years. If retained, justices then serve a term of six years.
Selection method sources:
Ballotpedia, Judicial Election Methods By State; Brennan Center for Justice, Judicial Selection: An Interactive Map