The four pieces every RL problem needs
Framing any task as reinforcement learning means defining four things. The state is what the agent currently observes about itself and the environment, for a robot arm this might be joint angles, joint velocities, and the position of an object it's trying to grasp. The action is what the agent can do at each step, for that same arm it might be the torque to apply at each joint. The reward is a numeric score received after each action that defines what 'good' means for this task, for example a small positive reward each timestep the object stays gripped, and a large reward when it's placed at the target. The policy is the agent's learned strategy for choosing an action given a state, the thing that gets trained.
These four pieces interact tightly. The state has to include enough information for the policy to make good decisions, if the agent can't observe whether it's actually touching the object, no policy can learn to grip it reliably. The action space has to be expressive enough to solve the task, but not so large that learning becomes hopelessly slow. And the reward has to actually reflect the outcome you want, which turns out to be far trickier than it sounds.
