The best way to invest in bonds is to understand the different types of bonds there are and choose the right kind for you.
Therefore, you have to understand all the options you have, evaluate your goals, and decide which one would suit you better.
Fortunately, each type has its own benefits and disadvantages depending on your goals, so choosing among the different kinds is not that hard. Corporate and municipal bonds are very different, for example.