Photographing through glass inside
When photographing an object behind glass avoid using a digital camera flash. Instead, shoot the object from the side that has the most lighting. Be sure to position yourself in a way so as not to block the light and so there are no lights coming from behind the subject.
Place the camera lens against the glass. Ideally, the lens should be perpendicular to the glass.
When lighting is extremely low, to help prevent blur due to camera shake, use a tripod or increase the camera sensitivity (ISO). Or do both.
If you must use the flash
If you have no option but to use a flash, step back as far as you can from the glass when using it. Also hold the camera (0r an external flash) at a 45 degree angle to the glass to minimize or eliminate glare. If your camera has a setting to control flash output, known as flash compensation, decrease it.
Photographing through glass outside
When shooting through glass outside in bright light, use a polarizing filter. Rotate the filter until it reduces reflections. With a polarizing filter, you shouldn’t have to hold the lens against the glass.
Watch the angle you’re shooting from to keep reflections, including your own, at a minimum. You can minimize reflections by also changing the height of camera. If you see your own reflection, move around until it’s gone if changing the camera angle doesn’t help.
When glare is unavoidable
Whether taking inside our outside shot, there are time that glare is unavoidable. If so try to make it as small as possible and appear in the least conspicuous area on the photo. You can crop or clone away the glare when editing.
Take shots at multiple angles to help ensure that you get a good shot.