It's a mess. We do not elect federal judges; they are appointed. We do elect judges at the state, county and municipal elections in non-partisan elections. Voters don't know the candidate's political affiliation.
Voters also generally don't have any direct knowledge about judges' records either. In my state, the conduct of candidates for the judiciary are rated by lawyers. (There's a group of trustworthy people!) The results of the rating process are printed in the voter guides, but it doesn't tell you much about who these people are. It is impossible to make an informed choice, so I don't vote those ballot lines except in those rare instances when I have direct knowledge about a particular judge.
The appointment of judges is also tricky as those are political appointments made by whomever happens to be in power at the time. The Supreme Court is the perfect example of the political gridlock gripping government. The US is stuck with nothing less than an activist court (left leaning or right leaning)--unelected--making law. Just nine people making law for a nation of millions. Something pretty anti-democratic about that, too.
And, to make matters worse, because federal judge slots are appointed, a vacancy rate of 10% hangs over the nation because Congress won't confirm the nominations for political reasons. This explains the vacancy on the Supreme Court right now, along with the 90 vacancies on appeals and district courts as well.
It's some kind of crazy system.