All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
The Istikharah prayer is prescribed for one when he wants to do something.
The Prophet said: “If anyone of you thinks of doing anything, he should offer a two Rak’ahs prayer other than the obligatory one…” [Al-Bukhari]
Therefore, if you decide to do the exam, then pray Istikharah, prayer whether or not you are ready for the exam, and performing the Istikharah is not difficult.
We did not understand what you exactly mean from your statement ‘If the result is positive, but I do not take the exam’; if you mean that you have done the Istikharah and were content with the result of the Istikharah for taking the exam, but you did not take it due to its difficulty or lack of time, then there is nothing wrong with you in this and you are not obliged to take up the exam.
Whatever Allah decrees for you after the Istikharah is the best, whether or not you took the exam, and whether the exam was difficult or easy.
For more benefit on how to perform Istikharah prayer and how to supplicate Allah, please refer to Fatawa 172573, 81434 and 82964.
Allah knows best.