A good way of collecting a stool sample from your baby is to wait until your baby poops in their diaper and then when you change the babies diaper take a sample of the babies stool out of their diaper.
Collecting a stool sample from an infant or toddler if the toddler is wearing diapers is to just collect the stool sample directly from the diaper.
If you want to do it another way then you could wait until you know the baby is gonna poop and then have them poop on a towel or something and collect the stool sample from the infant or baby that way but I would just take the stool sample from the diaper if it were me.