Is this sentence correct?
I am afraid not of preparing for the exam but of the result.
Or is there some other way to write that sentence?
What you have written is certainly correct (well, given the insertion of the), but it might sound somewhat literary to some folks. Compare these:
The first differs from yours mainly in punctuation and cadence.