According to Hindu beliefs, this earth is the karma bhoomi, where the fruits of actions of your past births (other than the effects of extreme evil deeds that have to be suffered in hell till a period and extreme good deeds that have to be enjoyed in heaven till a period) have to be exhausted through your experiences in the current birth. Till a person attains self-realization/ god realization/ sakshatkar/ Nirvana, the repeated cycles of births and deaths shall continue.
It is like the process of alchemy to turn a rusted piece of Iron to pure gold. Till the process ends, the chemical treatments (the births, pains and pleasures and deaths) will continue.
Whether you are going to accelerate the process (by doing more of good) or decelerate it (by engaging in evil deeds) – the choice is given to you.
Whether to pass or fail in an examination is up to you. But you have to necessarily sit for the exam. No choice!