Whenver possible, elicit the employee's suggestions about how to prevent the problem from recurring. Put the responsibility for suggesting solutions with the employee. When possible, help the employee implement their solution. Make it clear that your comments pertain to behaviour or performance, and not the person. Some think that putting the fear of God into employees will spur them on to better performance.
Fear is more likely to reduce performance, loyalty and effort.
If you never recognize effective performance, and do not praise those who perform well, you will not be effective in dealing with problem performance. Above all, remember that even the best of employees will find a discussion about inappropriate performance to be unpleasant. Some will take it personally, some will not. Be prepared for some defensiveness, and do not rise to the bait. Stay in control of yourself, and the situation.