I'm not sure that there is a best way. As with so many aspects of training, it's more important that you do it, rather than how you do it.
That said, intervals between 3-8 minutes duration with enough rest to allow ~15-30 minutes of total work should be a good start. They can be done as a dedicated workout or intersperse within a longer ride, it doesn't matter.
There are also several threads discussing them in more detail.