Answer:
You can fill in the blank with "to pass" or "for passing".
"I worked hard to pass my exam" is the most common way to say it. It means that you studied and practiced hard in order to achieve a passing grade on your exam.
"I worked hard for passing my exam" is less common, but it is still grammatically correct. It means that you put in a lot of effort in order to pass your exam.