Try to use warm wet towel with some soap to clean a small area. After it dry, if it makes some different, you can try DIY or hire someone to clean the carpet. If it does not make any difference, the carpet is worn, clean it wouldn’t make it any better. It is time for new carpet.