As with many things to do with running it is important to experiment. Every one is different and has strengths and weaknesses. Nevertheless there are some basic building blocks that should be present for anyone trying to run a faster 5k. Very experienced will have their own ideas about how to train, so this article is mainly aimed at people who have run a bit, but do not have a clear idea how to train.
Getting the best out of yourself takes practice, and racing is no exception. 5k is short enough that you can practice quite often without compromising your ability to train well (longer distances can be problematic - a race can take a lot out of you so you need time off to recover). The optimal strategy for a fast 5k is an even pace for about 4.5km and then to kick hard. You might need a few iterations to find the right pace. The first step is to run a race to establish a target pace. A good target is about 15 seconds faster than your recent best (this is probably too aggressive for highly trained, fast runners - but realistic for many of us). So suppose you have recently managed to run around 20:15 - then breaking 20 minutes is a good target. Obviously the average pace is 4 mins/km. However you should go out slighty slower than this. For the first 4.5km you should run at around 4:05 min/km.
The biggest mistake than inexperienced racers make is starting too quickly. Learning control in the first half of the race is an important skill.
With around 500m to go you can afford to speed up significantly. If you have been running at 4:05 min/km for 4.5km then obviously you will have taken 18:22.5 to get to that point, so you need to cover the last 500m in 1:37.5 to make 20 mins - so you need 3:15 min/km pace for that section. It's hard to get useful feedback about your pace over such a distance - so again it's a question of doing it by feel and getting used to what that pace feels like.
Consider buying some racing flats for your races if you do not already have some. But do not be tempted to use them all the time - reserve them for your races and interval work. Doing too much running in flats risks injury if you are not used to them.
5k is an primarily an aerobic event, doing well relies on your heart and lungs being able to deliver plenty of oxygen, and for your legs to be able to utilise it.
Aerobic conditioning comes from doing lots of easy running. Easy runs should not feel hard, exact pace is unimportant. Guard against working too hard - you'll compromise your ability to put in enough miles and risk injury. As a rule of thumb you should be running no faster than 50% slower than your 5k pace. So someone running a 20 minute 5k is doing 4 min/km at race pace, therefore easy runs should be no faster than 6 min/km. But do not treat this as a target - slower is fine!
You should do as much easy running as you can make time for; but do not increase mileage suddenly - gradually build things up and listen to your body. If your legs feel very heavy then you have done too much - cut back a bit until you feel better. In any case you should have a lower volume week every 3 or 4 weeks. It is often not necessary to explicitly plan this out - for most of us real life will intervene so that it becomes difficult to fit in your usual running from time to time.
It is good to mix up the distance of your easy runs. The minimum should be about half an hour, and the maximum about 90 minutes. If you are in training for a marathon you might do longer, but for a 5k is little point. But you can run more than once a day so long as you are not overdoing it.
Once a week you should get used to running for a sustained period at a pace that is closer to your race pace. These tempo runs should consist of 15 minutes easy running to warm up, then 20 minutes at about your 10km race pace, and then 15 minutes of easy running to cool down. 10km race pace will probably be around 10 seconds per km slower than your 5k pace.
In order to run fast your body needs to get used to running fast. For a 5k you need to spend some time running at the pace that you will in the race. There are two paces to practice. The pace for the first 4.5km, and the pace for the kick.
Once a week you should do some intervals at race pace. These sessions should consist of 10-15 minutes easy running to warm up then a set of intervals that add up to about 5km - for example: 6x800m, 5x1000m or 3x1600m, followed by 10-15 minutes easy running to warm down. Walk or jog slowly between each interval for about 50% of the time it took to run the interval.
Finally you should practice the speed that you need for your kick. Many inexperience runners, or even runners that have trained for longer distances are not used to running this fast. These sessions need not make up much total distance, the idea is to get used to the feeling of running at speed. So a session might look like 10-15 mins easy warm up and then 10x200m at your kick pace with 200m walk/jog recoveries or 5x400 with 300-400m walk or slow jog recoveries.