Protein shakes contain the amino acid tryptophan, which promotes sleep (1). You should ideally take it before a workout to keep yourself active or before going to sleep.