Hello,
You have not mentioned any particular class or board but I'm assuming you are talking about boatd exams. If you have failed in only one subject then you can give compartment exams which will be held in a few months. You won't have to repeat the class in this case.
However, if you have failed in more than one subject then you will be declared as failed overall and will have to repeat the class again.
I hope this helps,
All the best
Regular exam updates, QnA, Predictors, College Applications & E-books now on your Mobile