When a charged defendant is brought before a judge for hearing, the judge will ask the defendant if he or she wants to hire an attorney privately or use a court-appointed attorney for their defense. Before a defendant can qualify for access to court-appointed attorneys, he or she must be facing a criminal charge that carries the potential for an imprisonment sentence if convicted. They must further prove indigent, not being able to afford legal counsel, and will be asked to divulge financial information verifying their situation. If the judge determines that the defendant cannot afford, counsel, they will approve the request for a court-appointed attorney.
In most cases, court-appointed attorneys are not completely free of charge unless the defendant is not convicted of the crime they were originally charged with. Typically, if a defendant is convicted, a judgment is entered requiring payment based on several factors including financial situation, severity of the charge, and depth of defense. In most cases, court-appointed attorneys are less costly than private attorneys.
As per your friends claim, that if court does not appoint you an attorney, they will throw out the case, that is not true. If you can not afford an attorney and you do not qualify for a public defender, most likely you will have to proceed pro se, meaning that you will represent yourself, however if you can not afford the court cost, you can pick up an application from the court clerk and you can apply to the court to proceed "In Forma Pauperis." Although that phrase means "In The Form of a Pauper," you don't have to be completely destitute or without funds to use this procedure, this will eliminate all cour fees.
If my answer has been helpful, please ACCEPT my answer so I can get credit for my effort to assist you. FEEDBACK is appreciated as well as a bonus.