You can ask before or after a hearing. If you didn't check the box on your ticket or if you didn't ask for it at the hearing, call the court. Ask how to set up a payment plan. Do this as soon as possible. The clerk may not be able to set up a payment plan once the fine goes to collections.
Prepare to have proof of your financial situation including proof of public assistance (examples: food stamps, ABD, TANF, SSI/SSDI), rent, mortgage bills, utility bills, pay stubs, tax forms, debts, and so on. Bring as many of these as you can to show you can't afford the fine.
You can ask the clerk about community service options too. You can also ask the court to convert your fines into community service by writing the court a letter. In the letter you should explain to the judge why you can't afford the fines and ask for community service instead. Ask the clerk to give the letter to the judge.