If you fail a class you receive what is called a "punitive grade" for that class. A punitive grade is a grade that doesn’t count as earned credit, but is used in determining a student’s progress toward graduation requirements. This means that the grade you receive counts in your overall degree progress, albeit negatively. Since this grade counts towards your graduation progress you are not required to repay any GI Bill money you received for that class.
You may take the class again in an attempt to raise your grade and you will receive GI Bill payment for the retaking of the class.
Please note that retaking failed classes will use months/days of your benefits.