Weather awareness certainly is a very important part of pretrip planning before even a short local flight.
While cold air masses usually are of higher density than warmer air, wind direction and pressure play key roles.
What makes it a "front" is movement over the ground one way or the other. Cold fronts are usually sharply defined because the denser air moves underneath the warm air and pushes it away. Precipitation can be intense, but short lived, followed by rapid clearing.
If the wind direction is right, such as ahead of a low pressure area (in the northern hemisphere), warm air will advance across the ground. These fronts ride up over the colder air, sometimes for hundreds of miles. They bring lowering and thickening clouds, "showery precipitation", and fog before finally moving through.
Warm fronts are notorious for creating freezing rain under the right conditions and must be approached with caution when flying. Cold fronts primarily carry the risk of severe weather and turbulence.
When cold and warm sit side by side with little movement, or are moving in the same direction (as near the middle of a low), they are said to be occluded.
Another type of front is a "dry line". Humid air is less dense than dry air of the same temperature. Dry lines should be watched as they also can produce severe weather and turbulence (as would that second diagram!).
Generally, the cold front and warm air wind directions are more perpendicular to each other.