Answer:
He used an interpreter, someone who could speak both languages. Or an adviser.
Malinche was in the middle of this event, translating the conversation between Cortés and Moctezuma.