They both can mean "to happen" I'm not sure what the difference is. Please provide a sentence example. Thanks.
Fariĝi can be considered a passive form of to make or to do. I think it would more often be translated by to become. For example:
Mi fariĝis kuracisto – I became a doctor
Lia dorso fariĝis rigida – His back became rigid
You could also translate it with to be made or to be done. That is probably the source of the confusion because that kind of sentence could also be replaced with okazi. However, with fariĝi I think there is an emphasis on the fact that something came into being or was created.
Fariĝis lumo! – Light was made! (like in the bible)
Kiam la suno leviĝas, fariĝas mateno – When the sun rises, it becomes morning
Okazi is more about an event taking place in time.
La Universala Kongreso okazas ĉiu-jare – The UK happens every year
Se la fina venko okazos, estos monda paco – If the final victory (of Esperanto) happens, there will be world peace.