Cooling through quantum criticality and many-body effects in condensed matter and cold gases