What did the council of indies and viceroyaltys actually do? How did they govern?
Hi! This specifics of the answer to this question would depend on the exact region under Spanish control - which political bodies held power and how varied throughout the Spanish New World. Likewise, the appearance and structure of Spain's colonial governments changed over time. I will however try to offer a general answer to the question.
Viceroys were administrators appointed by the Spanish Crown in order to govern the various colonial possessions. Some of these colonial possessions were New Spain (Mexico), Peru and Rio de La Plata (Argentina). Viceroys were more than just governors; they were the representatives of the Crown's authority in the New World. In fact, the word 'viceroy' in Spanish is 'virrey' which can be roughly transliterated as "vice-king." Viceroys then were the men who were, ostensibly, in charge of the colonies they were in charge of, at least on the ground.
The Consejo de las Indias was the European side of Spain's colonial administration. They received reports, looked through trade ledgers and read and wrote letters from/to the New World. It was the job of the Consejo de las Indias to understand what was happening in Spain's American possessions. In turn, they gave reports to the King, transmitted royal instructions and offered recommendations on what they saw as appropriate courses of action.
The viceroys then ran and were, at least nominally, in charge of the various divisions of the Spanish New World, and the Consejo de las Indias served as a conduit between royal institutions in the Old World and the New. As you may have guessed, the actual day-to-day governance of New World possessions could vary widely. Particularly in the early years, Spanish officials in the Catholic Church took a leading role in establishing the actual governing institutions of the New World – the Inquisition was involved in Spanish America from a very early date. Without more specifics on where and when precisely though, it is difficult to speak to exactly which institutions were most important to government in Spanish America, and how they functioned. The best help then might come from comparison. English colonial possessions were (for the most part) established by colonial companies with charters from the Monarchy. Consequently, English possessions had a complicated legal relationship with the Crown. Spain’s colonies on the other hand were directly incorporated into the Crown. Viceroys served as governors who were appointed by the king and trusted to run colonies in the King’s name. In turn, the Consejo de las Indias was the point of contact between them. If any part of that is unclear, or you have follow up questions, I’d be happy to answer them as best as I can, but I hope that helps!