I used to work. As time passed, I got medically unfit and I starting slacking off at work and also started hating my job. The time I slacked off, is it counted as haram earning?

If you didn't work against what you were been paid then it's haram