The first translators learned languages through immersion. The example on the top of my head is Geronimo de Aguilar.
Aguilar was a Franciscan friar living in Panama in 1510. Due to conflict among leaders of the colony, Aguilar left and sailed to Cuba to initiate a suit against the opposing faction of the colony. However, the ship was wrecked and the survivors ended up on the coast of Mexico. The survivors were captured by the Maya and kept as slaves. All but Aguilar and one other died. They managed to learn the language during their captivity.
During Cortez’ expedition, he received word that there were Spaniards living among the natives and he sought them out. Aguilar joined the strongman’s expedition and served as a translator.
Another famous translator on this expedition is La Malinche— an indigenous woman. She is often described as Cortez’ wife, though more likely the relationship was founded on violence, not mutual affection. Cortez’ letters clearly indicate her has having the role of translator.
These translators were integral in the conquest. They allowed for an alliance with the Tlaxcala people who were crucial to the fall of Tenochtitlan (Mexico City).
Throughout Latin America, missionaries filled the role of translators. They were spread across the empire including in the most rural areas. They were closest to the indigenous peoples and functioned as the enforcement arm of the administration. They learned the languages out of necessity and tedious study.
It was also common practice to take the children of prominent indigenous leaders and send them to be educated in Spain or later at institutions within the colonies. The resulting scholars did a lot of translating work.
Lastly, there are also plenty examples of people learning languages from texts like the Rosetta Stone. My background is in Latin American and Caribbean history so that’s why I’m leaning on it.