I'm a US citizen that has never applied for dual citizenship. My husband is a UK citizen. We have worked in the UK for 30 years. What happens if he dies and I am still only a US citizen. My son is dual citizen for US and UK
Applying for citizenship under the more favourable rules for spouses will not be possible anymore so that would be one major consequence of the death of your husband in this respect. If that's what you want to do, it would make sense to start the application immediately, I don't see any downsides.
But of course, the biggest difference between the eligibility criteria for naturalisation for partners of British citizens and those for other applicants is that the former only need to have lived 3 years in the UK compared to 5 years for everybody else. Since you have lived in the country for much longer than that, it would not really matter.
Beyond that, there should still be multiple ways to retain residence rights and ultimately gain citizenship depending on the details of your situation. In particular, it would still be possible to apply to settle in the UK based on your relationship, even if you hadn't done so before your husband's death.
And if you have lived in the UK with your son for a certain period of time, you would also qualify for a visa on that basis alone (wouldn't make much sense for you since you are probably already settled or eligible to apply for an indefinite leave to remain but it's still one way to remain in the UK for people who have nothing else).
Finally, it would not be the easiest or most logical route for you but after 30 years, I believe it's even possible to apply for an indefinite leave to remain on the basis of the duration of stay alone (even if some of it was unlawful and without relying on your husband's or son's status in any way!).
So depending on the specifics of your situation, it might involve a bit of stress and paperwork (or even hiring a solicitor) but you should definitely be able to find a way to continue to work and live in the UK.