Warming up before a race (and also before training) is really important to prepare yourself physically and mentally for the hard effort that is coming up. Developing a warm-up routine that you practice before the actual race takes place will remove unnecessary stress on race day and ensure you are ready to go when it counts.
From a physical side, when you first start moving, your muscles are cold and blood vessels are narrow. Gentle movement warms up the muscles and heart and prepares you for physical activity. Body temperature rises, blood flow increases and allows oxygen to be transported faster to the muscles. Altogether, this will both make you faster and less likely to be injured.
From a mental side, warming up helps you to slowly get in the zone that will allow you to dig deep. It gives you a chance to think about why you are willing to endure the discomfort. Making yourself aware of your goals and commitments in advance of workouts and races can help you to get ready for the hard effort that is about to follow. If your mind is not ready for pain, it will probably result in less-than-optimal performance.
In general, the shorter and more intense the effort to be completed, the more thorough your warm-up should be. However, all sorts of warm-ups usually start with 10-15 minutes of easy aerobic movement. This can be swimming, biking or running depending on the effort to be completed later. For an easy workout, this can already be enough, and you can continually build towards the desired effort. For harder workouts, you can also include some dynamic stretching, technique drills and strides before you start with the hard portion of the workout.
When preparing for a race, the length and intensity of the warm-up depends on the race distance to be completed. For Sprint and Olympic distance races, I would recommend doing a 10-15 min easy run followed by some dynamic stretching and some strides about 60-45min before the race starts. Some people also like to add in some biking or replace the running by biking. However, oftentimes your bike is not available for warm-up anymore because it is already racked in the transition zone. Hence, be sure you will have a bike available when you plan to do a warm-up on the bike.
After the first part of your warm-up, you can go to the water, put on your wetsuit if necessary, and swim for another 10-15 minutes about 20-25 minutes before the race starts. Again, just like with running, try to build in some harder efforts at race pace towards the end of the swim warm-up to get your body and mind prepared for the effort that is about to follow. Plan to make your way to the start line about 5-10 minutes before the gun goes off.
And finally, try to put a smile on your face in the last few moments before the start. Remind yourself of all the hard work that you have put into training over the past weeks and months. Now is the time to show what you are capable of and enjoy the race.