One of the most common ways we study babies is with habituation. Essentially what we do in these studies is test how long it takes for a baby to look away, meaning they got bored of looking at the same thing. What this tells us is if the baby can see a change or difference in what they're looking at.
One of the more known habituation experiments involved 3 month old babies who watched someone grab an object repeatedly until they got bored. Researchers tested whether the baby was focused on where the hand was reaching, known as the goal, or the path the hand took by seeing what the baby was getting bored of. Here's how they did it. They first showed the baby a hand reaching in the same path as before, but switched the objects and put the teddy bear where the ball used to be and vice versa. Once seeing this, babies still didn't show much interest, meaning they thought "I've seen this before". However when they showed the person reaching for the ball in the new location, babies got interested again, meaning they were interested in seeing the hand reach in a new path. This showed that the babies weren't focused on the goal of the hand. It doesn't stop there!
When babies were given the toys to play with beforehand, with the help of "sticky mittens" for better hand coordination, and then shown the habituation experiment, they're more interested in the change of goal. With this, we found that babies as young as 3 months can understand that people have goals and people can choose different paths, but what we can take away from this is experience acting on the world affects infants' perception. More on infants' perception of what others are capable of!