As you are doing intervals you’ve already done the endurance part of your training right? So if you’re doing 5k you can already comfortably run 10k. If not get back on those long Sunday morning runs!
Intervals involve a period of exertion followed by a period of rest. Repeated.
Your intervals (excluding the rest bit) need to be ABOVE your target race PACE ie faster. Say 5% faster.
The best intervals for 5k are probably 1km long intervals with 2 minutes rest. Do at least 3 or at most 5. That’s a hard session. And it’s a hard session for ANYONE because the better you are the faster you will be running at. If that’s too easy have only one minute rest.
That is, in fact, probably TOO HARD for most people.
So you might want to increase your recovery time OR shorten the distance.
At the other extreme therefore you might want to do one minute intervals with one minute rest. Repeated at least 12 times and maybe 20 times. The 1km intervals are more effective though.
Or invent your own somewhere in between the two above. I would try and stick to a constant target pace. Perhaps only varying that pace on your last interval/set where you go as fast as possible. You can have sets of intervals where you run for different lengths of time (or distance) but I think that just complicates things. Keep it simple unless you are really bored by your training regime.
Remember though to get your endurance sorted out first.