After my flat flooded twice rather than replace the carpet again I went with tiles instead.
The problem was the lino under the carpet did have asbestos in it, and when the carpet was removed some of the lino was cracked so the asbestos was exposed.
It was a big job, I had to stay at my sons for a few days and the men who removed the lino were fully covered with masks etc.
I still have one room with carpet and lino underneath, so no matter how grotty that carpet is I just clean it rather than go through the hassle of having the lino underneath removed.
PS the lino was laid in the early 1970's.