"What do you know about him?"
Translation:Что ты о нём знаешь?
Wiktionary is good for telling you what the spellings are for each case. https://en.wiktionary.org/wiki/%D1%87%D1%82%D0%BE#Declension
Because «ему» is Dative, and «о» requires prepositional case.
Also, when pronouns starting with е- are used with prepositions, they get н- prepended.
When does "o" require prepositional case and when does it require the accusative case like in https://en.wikibooks.org/wiki/Russian/Grammar/Accusative_case ?
When «о» is used with Prepositional case, it means 'about, related to, of, on, concerning':
- Э́та пе́сня о тебе́. This song is about you.
- Я написа́ла о ней кни́гу. I've written a book about her.
- Мы говори́ли о це́нах на еду́. We were talking about the prices for food.
- Сю́ки вспо́мнил о Нацу́мэ. Shuuki remembered of Natsume.
When «о» is used with Accusative case, it means 'against' in the physical sense. When this preposition is used with accusative, it often has the form «об» even before consonants:
- Я уда́рился ного́й о(б) две́рь. I hit my toe against the door.
- Му́ха бьётся о(б) стекло́. The fly is hitting the glass.
The dative is known in English as the indirect object while the accusative is the direct object. Using the same examples above.
I write message to him. Here message is the noun that functions as direct object because the verb is on it (writing a letter). While to him is the indirect object because you are not "(literally) writing him" but TO HIM, in that case you use the dative form of он -> ему.
I write a message to my boyfriend about him (maybe a friend?). "Message" is the direct object, acusative. "To my boyfriend" is the indirect object, dative. Aaaand about him gives extra information ABOUT the message, in English and Russian you add preposition. This is called Prepositional case, in this example you use the preposition о, and the Prepositional form of он -> нём (not нем as posted above).