I still sometimes find it difficult, despite speaking German for decades, to distinguish between the two nouns die Gelegenheit and die Angelegenheit. In all fairness, though, the fact that prefixes like an-, be-, ver-, ent-, etc. radically alter the meanings of German words is part of what makes German difficult for English speakers.
Let's start by stripping Gelegenheit of its -heit suffix, leaving us with the adverb/adjective gelegen:
...eine Kleinstadt für sich, gelegen entlang der schweiz-französischen Grenze.
...a small town on its own, located along the Swiss-French border.Play Caption
Vor der abseits gelegenen Düne gelang ihm eine sensationelle Entdeckung:
In front of this remotely situated dune, he managed to make a sensational discovery:
Captions 22-23, Abenteuer Nordsee - Unter Riesenhaien und TintenfischenPlay Caption
Thus gelegen is usually translated as "located" or situated," though it also can mean "desired" (erwünscht) or "opportune" (günstig). When we add the suffix -heit and make it a noun, it becomes:
Die Gelegenheit lässt sich Florian nicht entgehen.
Florian doesn't let this opportunity slip by.Play Caption
Dann lernst du ihn auch gleich kennen bei der Gelegenheit.
Then you'll also get to know him right away on this occasion.
Caption 28, Fine - sucht einen HammerPlay Caption
Die Gelegenheit is almost always translated as "opportunity," except when preceded with the preposition bei, when it's usually translated as "occasion." On a more humorous note, just as "the facilities" are used in English as a polite euphemism for the toilet, so too is die Gelegenheit an old-fashioned euphemism in German for das WC. A perhaps overly polite way to ask where the toilet is would be Wo ist hier die Gelegenheit, bitte?
Die Angelegenheit is, on the other hand, literally a different matter altogether:
Die Königin war fuchsteufelswild und beschloss, die Angelegenheit jetzt selbst in die Hand zu nehmen.
The Queen was "fox devil wild" [slang: angry] and decided to take the matter into her own hands now.
Captions 55-56, Märchen - Sagenhaft - SchneewittchenPlay Caption
Musste zufällig jemand den Kaiser in kaiserlichen Angelegenheiten sprechen, gaben seine Diener stets dieselbe Antwort.
Should someone need to speak to the emperor about imperial affairs, his servants always gave the same answer.
Captions 20-21, Märchen - Sagenhaft - Des Kaisers neue KleiderPlay Caption
I use this mnemonic device to remember the difference between Gelegenheit and Angelegenheit:
–An "opportunity" should be easy and is thus the shorter of the two words, Gelegenheit.
–A political affair or business matter tends to suggest difficult bureaucratic procedures and is thus the longer word Angelegenheit.
Go to Yabla German to find other examples of gelegen, Gelegenheit and Angelegenheit as used in real-world context.