While both are grammatical, the infinitive form (
to keep cool) is more commonly used to indicate purpose, i.e., to answer the question "Why?" or "For what purpose?"
-- They wear light clothes.
-- For what purpose do they wear light clothes? (Why do they wear light clothes?)
-- To keep cool. They wear light clothes to keep cool.
-- They are saving money.
-- For what pupose are they saving money? (Why are they saving money?)
-- To go to college. They are saving money to go to college.
-- The chicken crossed the road.
-- Why did the chicken cross the road? (Children's riddle.)
-- To get to the other side! The chicken crossed the road to get to the other side!
CJ