Are you asking for a technique? Masturbation is sexual self-stimulation, usually to orgasm, but not always. Condemned in many cultures as a perversion of the "normal" sexual impulse, it's practically a universal practice among humans and quite a number of other mammals, and even a reptile or two. Like anything else, it can be done to excess, but there is no specific harm, physical or moral from indulgence. If the questioner here is, as I suspect, a young person, rest assured that this is definitely one of the things in life that "comes naturally."