In simple terms, when you ‘gybe’ a boat you are doing the same as you did when you tacked. In other words, you are changing the side of the boat that is presented to the wind. But instead of turning the front (or bow) of the boat through the wind, you are turning the back (or stern) of the boat through the wind.
For example, if you were sailing along with the wind on your right hand side side (a starboard tack) and you started to turn left (to port), the wind would seem to be moving behind you and onto your back. If you kept turning left, the wind would come onto your left side (port tack). You would have taken the boat from being on a starboard tack, to being on a port tack, but the way you did it was by gybing the boat. Tacking the boat, in contrast, would have had you turn the front (or bow) of the boat through the wind.
So, tacking is where the front of the boat goes through the wind and gybing is when the back of the boat goes through the wind.
WARNING! Gybing without preparation is dangerous. Unlike tacking, gybes require very careful control of the mainsheet. If the mainsheet isn't controlled in the gybe a ‘crash gybe’ will result. This is when the boom, mainsail and the slack mainsheet slam and whip across the boat very quickly. Anyone in the vicinity of the boom or mainsheet runs the risk of being hit and seriously seriously injured or worse. This is why we always take care, especially when gybing.