To be “cruel to be kind” is to cause someone pain for his or her own good. The phrase is used by Hamlet after he has berated his mother for her infidelity to the memory of her deceased husband.