Understanding the difference between good pain and bad, and the difference between hurt and harm is a major part of what makes you a good Top or Dom/me.
The books I told you about will tell you much of what you need to know. In the mean time, if you have any specific question regarding how things should be done, please ask.