I was working in Germany, and I also have the residence card, but I left for Spain, since it's also Schengen they didn't do any passport checks, also to work and also applied for the visa just in case but it take a while to come. Now my German residence card has expired. Do my 90/180day automatically start?
Ask a lawyer in Spain.
From what you are writing, you had a permit which allowed you to live and work in Germany, and also to visit other Schengen countries for 90 days out of 180.
Going to Spain to work might have made you an illegal immigrant from the first day you worked there, unless Spain gave you a work permit.
On top of that comes Covid-19 with the travel restrictions.
Since you don't mention any EU family members, I assume you had an Aufenthaltserlaubnis, a residence permit, rather than an Aufenthaltskarte, a residence card.
Your 90/180 counter started when you left Germany. A Schengen residence permit allows the bearer to spend up to 90 days in any 180-day period in other Schengen countries. If you were in Spain for 90 days or more before your German residence permit expired, you exhausted the 90 days before it expired.
As noted in the other answer, your German residence permit does not authorize you to work in Spain. You really ought to consult an immigration lawyer for advice on the best course of action.
(If your document really was an Aufenthaltskarte then it was issued under European Union free movement law because of a family member who is an EU citizen or a national of an EEA country or Switzerland. In that case, the above applies only if you moved to Spain without your family member. If you moved with your family member, there is no 90/180 limit.)