Remember there is positive reinforcement and negative reinforcement. We should try to rely on positive reinforcement but negative reinforcement is necessary.
"No - Don't touch that light socket." Should get an immediate reaction of obeyance from the child. It's a safety issue. If the child steps away from the socket, you reward the child with cuddles and soothing words, "what a great little girl!" You may/should sit down for a minute and reinforce that light sockets are dangerous and when she listensto you it makes you very happy. Use lot's of smiles etc.
If the child ignores you, immediately pick up the child and isolate her from everything. At 1 y/o a play crib works. Make sure she is not in danger or uncomfortable but let her cry and don't pay attention to her. No toys or other distractions. Think baby jail. 5 minutes at this stage is a long time. Afterwards don't cuddle her or apologize. Instead of seated on your lap as you may above, stand her in front of you and explain that light sockets are "bad" or "dangerous" if you think she understands that word. Also explain that she must listen to you or suffer more time outs.
At a very young age timeouts are short and rewards are immediate. Later as they get used to the concept of time. Timeouts are longer and rewards can be delayed.
Delayed rewards are important. Our son is now 9 and he understands saving his allowance over several weeks to get a new game for his game boy. He understands doing chores all week to get an allowance on Friday night. He understands clean his room means a trip out to the mall on Saturday.
Delayed negative reinforcement is harder but you should also develop this. Cancelling a planned weekend activity, no tv tonight for misbehaving in the restaurant at lunch etc.
We had friends with a 3 y/o that was a screaming terror in restaurants. This 3 y/o was an abomination and clearly wore the pants in the family. When our son reached 3 y/o he acted up once in a restaurant. I told him he would get a time out if he didn't straighten up. He pushed it, thinking there was no way to do a time out. I took him to the car, buckled him in the car seat and told him I was going to eat and I would be back in 10 minutes. I went to the back of the car where he could not see me and waited about 5 minutes, or until his wailing died down a bit. I then had the, "Are you ready to be a gentleman?" discussion again. He was very compliant and I never had another restaurant outburst after that. He really thought I went to eat and left him there. Some day when he has kids I'll teach him the trick ;-)
There are two responsibilities that we have. One they can't get too hungry. Two they can't get too tired. They are not wired to know when they are hungry or tired. When they get there they are unreasonable but its our fault. Likewise we can't let ur hunger, tiredness or other adult emotional problem bleed into our parenting role. We have to be ultra consistent.
Sorry for the long rant. The reward for us is that we are constantly told by strangers what a great young gentleman we are raising. The last time was an SQ flight in bus class. The purser kept commenting on what a "young adult" our son was. Great feeling for us.