when do babies start to fight their sleep?

at what age and is there a way to know there's what they're doing?