The Verdict: Need More Info
Your naturalisation clock has not started, so the first step is a residence permit. The fact to settle is which ground you can regularise on: family, work, a pension, investment or a treaty.
Brazilian law allows a residence permit to be granted whatever your immigration situation, so an overstay or the wrong visa does not shut the door by itself. Applying late can bring an administrative fine, which is a penalty, not a bar.
Once you hold the permit, naturalisation takes four years in the ordinary case, or one year with a Brazilian spouse, partner or child, or the nationality of a Portuguese-speaking country.
Every route also asks for civil capacity, no criminal conviction (or rehabilitation), and the ability to communicate in Portuguese. That is usually shown with a Celpe-Bras certificate, an ENCCEJA certificate or a degree completed in Brazil (Portaria MJSP 623/2020, art. 5).