The state Unified Health System (Sistema Único de Saúde, or SUS) provides a broad range of free health care services which are available to all people legally domiciled in Brazil, including foreign residents.
Should you need to see a doctor you will definitely be at an advantage if you have an additional private health plan or health insurance though. Indeed, relying on public medical treatment can sometimes turn into a nightmare, especially if you are faced with serious health problem.
One notable and very convenient difference between the Brazilian healthcare system and systems found in other countries is that you do not necessarily need to be referred by a GP in order to see a specialist.