Correct exercise technique is important not just for optimum fitness results but also to keep your body safe and thus (hopefully) injury-free. A very common error, most often because of lack of knowledge, people do not squat or lunge correctly. There are a myriad of factors that influence a person’s ability to do either one of these such as leg strength, familiarity, pelvic stability and body awareness, so it is important to get as many of these (ideally all) as correct as possible to reduce injury risk.
A basic squat involves keeping your feet about shoulder-width apart, spine upright, chest up then pushing the hips backwards and bending the knees as in the image below. The position of the arms can assist in balance if needed.
A basic lunge involves stepping forward, bending the knees to go downwards while maintain an upright spine and level hips, then pushing upwards again to reverse the motion and step back to the starting position.
So to achieve a healthy body alignment in either of these exercises it is important to be aware of what your body is doing throughout the movement – using a mirror and a spotter is a great way to achieve this. Traditionally “knees behind the toes” is a good general cue to help with alignment: one should always aim to keep the knee joint behind the toes, even over the ankle joint itself of possible, to keep the shear forces going through the knee at a minimum (these forces may lead to overuse of the cartilage in the knee and increase the chances of an injury). Another great way of getting this alignment right is to keep your knee over the second toe of the foot. Therefore, you should still be able to see your toes when performing a squat or alunge as in the picture here.Also important to remember is to check on whether your knee is caving inwards which often happens if the foot is over-pronated upsetting the biomechanics of all the bones in the ankle, shin, knee, thigh and pelvis. This next picture shows an example of this which I found on https://www.silversurfers.com in an article called The Strength of Strength.
Because we all have different body types and are at varying stages of strength and ability when exercising some people may find it more difficult to achieve the ideal alignment, but as long as you aim to get most of these alignments right, with practice, lunges and squats will become easier to do which will also make it easier to find and correct any issues. However, if you are in doubt or need extra help then get some more professional help with your exercise techniques.