Without knowing the type of pain you are experiencing when doing squats it is difficult to give a valid answer. You do the initial portion of a squat every time you sit down. The two most common errors when doing squats are leaning forward as opposed to sitting backward when you initiate the movement and then stopping the squat with the thighs parallel to the floor. The latter places the maximum stress on the knee joint.
More information as to what elicits the pain and any underlying structural damage or preexisting conditions will assist in you getting a more helpful response.