carpet in bad shape. what to do?

The carpet is in very bad shape. I tried painting it but its still very fuzzy and looks awful. Any solutions to fix this?