In most jobs, you can quit or your employer can fire you at any time. Unless you have a contract dictating the end of your employment, you are generally only protected from termination in a couple of ways.
The first is that your employer cannot fire you due to discriminatory practices. The second prevents your employer from firing you in retaliation for you doing a protected act.
Retaliation and protected acts
Retaliation is the firing of an employee because he or she exercised a legal right. These are protected acts. They may include serving jury duty or in the military, reporting safety issues, becoming a whistleblower or requiring an accommodation. The distinguishing factor about protected acts is that you are doing something to protect others, to handle a civic duty or to ensure you can do your job within the legal boundaries afforded to you under the law.
The law protects you in those various situations because they are things that would have led to the termination in the past before laws came into effect. For example, employers would fire someone for reporting a safety issue because it cost them time and money to deal with the effects. But the law protects you because if it did not, people would never report safety issues, leaving workers in dangerous situations.
If your termination was retaliation, you will have to prove it. It should be easy if you do not have a record at the company that began before the incident that triggered your termination. For example, if you have always received good reviews and have a stellar record with your employer, but after you report a safety issue, you suddenly keep receiving write-ups, then this could be good proof that your employer was trying to build evidence to fire you as retaliation.
Retaliation is illegal regardless of the situation. You should seek help for wrongful termination if your employer fires you as retaliation.