A robot is a machine that can sense its surroundings, decide what to do, and act on its own. Engineers call this the sense, think, act loop, and every robot, from a vacuum cleaner to a Mars rover, follows it.
Sense: sensors measure the world. A distance sensor tells the robot how far away a wall is; a line sensor sees a dark line on a light floor.
Think: a microcontroller, a tiny computer, reads the sensors and runs a program that decides what to do next.
Act: actuators, usually motors, carry out the decision by turning wheels, moving an arm or opening a gripper.
The loop repeats many times every second. That is how a robot reacts when something changes, such as a wall suddenly appearing in its path.
Try it: look around you and find one machine that senses, thinks and acts. What are its sensors, its "brain" and its actuators?