# like a rotten thing that wastes away
Job compares his life to something that is decaying. He is slowly dying.
# like a garment that moths have eaten
Job compares himself to clothes that are full of holes because the moths have eaten parts of it.