Prior to filing a bankruptcy case, you must undergocredit counseling. The certificate is only good for six months from the date of the session. This means that you must use it to file bankruptcy at any time within that six months.
The second course is called "Debtor Education" and it should be completed within 45 days AFTER your meeting with the U.S. Trustee. After this session, you will receive a certificate much like the first one. This certificate can be seen as your 'ticket' out of bankruptcy.