Story of a 5k
I try to get more than enough sleep in the days leading up to the race and eat a little healthier and more than I usually do. This becomes more important the closer race day gets. Sleeping poorly five days before a race won't have too big of an effect, but two days before the race it will have a noticeable impact. In terms of nutrition I try to add, not subtract. So instead of cutting out the sweets I always eat too much of, I just add a salad to my lunches. Depending on race day logistics, it makes sense to eat a large dinner the day before so you can cope with the reduced breakfast. Make sure you plan out all the logistics the evening before race day, so you're not stressed out by it.
Training volume should also be reduced during this time. I might do a session three days pre-race, but prefer to rest at least the two days leading up to a race.
On the morning of the race, your goal is to conserve energy and prevent any stomach issues. What works for me is a low fiber cereal with low fat milk at T-5 hours, coffee sometime after that cereal, one banana at T-2.5 and another banana at T-1.5 hours. This is for a race starting at 3pm, if the race starts at 10am I would skip the cereal and just do the bananas, with coffee first thing in the morning.
I leave an hour before the race start, provided logistics allow it, just packing my keys and some tissues, maybe some money for post race cake. The walk / bike to the start is kind of a first warmup. I do my regular warmup a little earlier than is ideal, starting at half an hour before the start. Its just my regular warmup with perhaps some more reps, and a kilometer jog added on.
First, I gotta catch my breath for 5-10 minutes. Then I check out the free stuff behind the finish line, get some water and/or protein bars and try my best to keep moving in a foolish attempt to fend of the lactic acid. I am not a big fan of extensive stretching. The muscles need rest, not being tugged on. I stick around the finish area for 30-60 minutes before slowly dragging myself home.
This is a good time to do a brief race review and then do next to nothing for the rest of the day. Maybe watch a movie or play some games. Going to bed early won't work because of lactic acid burn, at least last time I stayed up quite late because my legs kept me up.
If you have a lifting background you might fear that this pain correlates with the soreness in the coming days, but it really doesn't. The soreness the day after is not too bad, certainly less than after any reasonable "leg day" in the gym.
Take at least two days off and then you can get back to regular training. This is a mental thing as well: If during the next race I know I won't run for the next 2-3 days I am free to push as hard as I can.