The preposition in is used when followed by a standard noun. Generally is used when talking referencing a specific situation/location.
I succeeded in school.
I did well in mathematics.
He always succeeds in activities like these.
The goalkeeper is very good in tournaments
The preposition at is used when followed by a verbal noun (-ing form)
He excels at writing, public speaking, swimming etc.
He succeeded at convincing me.
She is very good at singing, teaching, studying etc.
You will often hear things like “I’m good at math/chess/poetry.” which seem to break the rule, but the speaker is just omitting the verb.
I’m good at [doing] math. I’m good at [playing] chess. I’m good at [writing] poetry. in would no longer work when the verb form is added.
The ‘exceptions’ which Joel - Spanish listed appear incorrect. “I want to succeed at school” sounds completely awful. in is absolutely required there. “succeeded in raising public awareness” sounds acceptable to the ears but ‘at’ would sound just as well if not better.