A lack of oxygen in the blood stream getting to your brain causes yawning. When you are very relaxed, your breathing tends to slow, and become shallow. Deep refreshing breaths will help to eliminate the need to yawn.
Yawning is caused with the levels of clucoise supplied to the brain decreases. Tiredness and sleepness. It is contagious. It also controls the temperature of the brain.