Your first sentence is almost correct: "en" replaces something with "de", "y" with "à" (or another preposition of place: chez, dans, etc), and le/la/les otherwise.
But it's not the phrase itself that determines which of the above - it's the grammatical construction. In this case, Je suis certain de quelque chose.
It doesn't matter what the "quelque chose" is - je suis certain has to be followed by de, which means that it and the thing I'm certain of have to be replaced by en. So "I haven't even seen the phrase that le/y/en refers to yet, so how can I chose?" doesn't matter.
Does that make sense?
Sign in to submit your answer
Don't have an account yet? Join today
Test your French to the CEFR standard