I know that there were laws giving indigenous peoples the same rights as whites and criollos, but what was the effective situation? Did indigenous peoples have those rights in practice, or they only had them "on paper"? What was the relation between blacks, criollos, mestizos, whites and "indios"?
That's a huge question that spans many books and debates. How native people partook of colonial justice (they had rights but not the same as Europeans) and how the groups you mention interacted as part of casta system is really complex. I've written here on various aspects of it, especially for Mexico:
This one has a part on the casta system https://www.reddit.com/r/AskHistorians/comments/b2l1gd/what_were_the_main_reasons_why_the_spanish_mixed/eitpb5b/
Parts here on indigenous (Aztec) uses of the colonial legal system https://www.reddit.com/r/AskHistorians/comments/88a0qu/why_did_the_spanish_conquest_of_mexico_end_up/dwj7dmf/?context=10000
On Africans and African slavery in Spanish America https://www.reddit.com/r/AskHistorians/comments/behgik/why_did_african_slavery_and_plantation/el65uci/
If I'd recommend just one book on all this it's "María Elena Martínez's Genealogical Fictions", a great study of limpieza de sangre and the casta system.
Hope this helps!