Some counties allow you to make application at the Preliminary Hearing and some will have you fill out an application after the preliminary hearing and submit it to the District Attorney by mail. I am not aware of any county that has you fill out the application before the preliminary hearing. You would be well advised to contact a criminal defense attorney who practices in your county and who is familiar with the local procedures. If you can't find such an attorney here on AVVO then your best bet is to contact the Bar Association in the county where you were arrested and speak with their lawyer referral program.
Best of Luck
A roundup of the best tips and legal advice.