Don't put the cart before the horse
Do not do things in the wrong order.
کارها را به ترتیب درستش انجام بده.
سرنا را از سر گشادش زدن
You have to study more and then retake the exam; there is no use in taking the exam again when you haven't studied for it. You know, my grandma always said, “Don't put the cart before the horse.”