If you signed your agreement before October 1, 2018, there is no absolute bar to enforcement of a non compete simply because you were laid off or terminated without cause.
That is not to say that the nature of your termination is irrelevant to the analysis. A court still must determine that the agreement is reasonably necessary to protect a legitimate interest of the employer. If the company has re-organized, for example, and what you do is no longer relevant to that business, a court may well find there is no legitimate reason to enforce the non compete.
In addition, most times when employers seek to enforce a non compete, they do so by asking the court to issue a preliminary injunction prohibiting you from taking the competitive job. This is what is called an equitable remedy, and the court is required to consider the