In the US, what happens if you refuse to hire a lawyer?

Assuming the court has decided you can afford a lawyer, what happens if you simply refuse to do so? (And you refuse to represent yourself.)

Is this a criminal matter, or a civil matter?

How are you refusing to represent yourself? If you don’t have a lawyer you are representing yourself. If you refuse to defend yourself at trial I’d expect the prosecution will have an easy case.

In a criminal case in New York that I followed, a public defender was appointed, and the defendant was billed for his services.

Sometimes the court will go easy on you and appoint a lawyer to take the case who will then send you a bill, sometimes they’ll let your idiot self just sit there saying nothing while the prosecutor convicts you, then send you to prison for the full term. You don’t get to opt out of the law.

In Illinois, if you are out on bail and a public defender is appointed, the public defender’s fee comes out of your bail money, instead of having it returned to the defendant.

Constitutionally, you have a right, but not an obligation, to be defended by counsel. Typically, a judge can use his discretion and order a defense attorney. After all, the responsibility (theoretically) of the judge is a fair trial, not a conviction.

In capital cases, the judge often refuses to accept a plea of guilty, and requires that the defendant plead not guilty and go to trial, rather than to send a person to the gallows without one.

This is the rule in most, if not all, of the US. Only for criminal matters, of course; there is normally no constitutional right to counsel in civil cases.

I’m guessing that if you refuse to hire a lawyer you usually lose in court.

ETA: I’m positive that’s true in criminal cases.

Less true in criminal cases than civil cases. The burden of proof is much higher in a criminal case (and presumably we’re not talking about the government refusing to hire a lawyer). Sometimes, a defendant doesn’t need to present any evidence at all to win. That almost never happens in a civil trial.