When you obey, you follow someone's rules or instructions. In the old days, all of a monarchy's citizens were expected to obey the commands of their king or queen.
You might be expected to obey the rules your strict parents lay down, or to obey the guidelines of a group or club you belong to. Religious Christians obey God, and soldiers obey the direct orders their commanding officers give them. To obey is to be obedient, and both words come from the Latin obedire, which literally means "listen to," but is used to mean "pay attention to."