What is wrong with my succulent?

I bought a succulent recently, and it sees to be rotting from the root up. Is there anyway I can prevent it from dying? What is wrong with it?