If you did not pass your exam you may re-take it at a later date. You can either take the exam the next time the course is taught, but there are also re-exam periods to re-take previous exams, see the exam schedule on the main page for exams.
To be able to take a re-exam you have to register for that re-exam for the occasion you want to do it. More specific instructions can be found under Registering for the exam.
You may re-take the exam of a course as many times as you like as long as the same version of the course is still being taught as the one you were first registered on. If a course you have taken will no longer be taught, or the course code and thus its contents change, you have the right to do the re-exam for the previous version of the course for up to one year after that version is no longer taught. Contact the Study adviser if you have any questions.