A public defender is better than having no lawyer at all and usually a public defender can win your case in court just as good as a private lawyer.
However public defenders are provided to you for free in the event you cannot pay for your own private attorney or lawyer.
If you can actually afford a lawyer then it's best to pay for a private lawyer who will have more interest in your case than a free public defender would.
You can usually make payments to a lawyer and not have to pay the full amount of money you owe to the lawyer right away.
So if possible hire a private lawyer which will be much better than a public defender but if you do not have money to pay for a lawyer a public defender will be better than showing up to court without any lawyer or public defender.