The correct option is
C waste energy on a lost cause
'To flog a dead horse' means to waste effort on something when there is no chance of succeeding. E.g. He keeps trying to get it published but I think he's flogging a dead horse.
Thus, option D is the correct answer as it signifies the same meaning.