A castled king isn't always a safe king . You can often sacrifice material to lure the king into danger. One good example of this sacrifice is the "Greek Gift Sacrifice." This is an attack with Bxh7+, followed up with a knight and queen to checkmate or win material.