Another way to say "a hat is used for keeping your head warm" is "Hats prevent heat from escaping your head"