합격 and 기원 come off Chinese roots.
If you learn Korean words with understanding of 한자, you will be able to learn Korean better and more flexibly.
합(合) means roughly 'to join together', 격(格) means roughly 'standard' - so 합격 means your ability fit into their standard. The antonym is 불합격 - 불(不) is like the English prefix, 'non-'
기(祈) means 'to pray'. And, 원(願) means 'to want', also 'want' as a noun. So 기원 means 'to wish' or 'wish' as a noun. Now you can make it into a verb by adding a verb-maker, "하다", it is "기원하다". It also applies to 원 - 원하다 to want.
Hope it helps.