The selection method for state judges in the U.S.A. varies from state to state.
They can either be elected or appointed, and sometimes it even is a combination of both (for example, an appointment followed by an election).
When they are appointed, it is often by the governor of the state or by a committee who selects them according to their merit (track record).
When they are elected, the citizens choose among a list of candidates. If this list is proposed by a political party, it is called a partisan election.