rotting euphorbia ?

Hello – we have a very tall but sickly looking euphorbia (I think it’s one). Can it be saved? Should the rotten top be cut down? It’s covered with it’s prickles so I’m not sure how it can be re-potted.…