Both. You need a well-diversified portfolio with exposure to stocks, bonds, real estate, precious metals, commodities, etc. You can achieve this exposure by buying mutual funds or Exchange Traded Funds (ETFs).
You also need to make sure that you have a proper asset allocation. Since you are 23, if the money you are talking about is earmarked for retirement, you probably have 40+ years for the money to grow. Given this time horizon, and not knowing anything else about you or your situation, you can probably target a pretty aggressive allocation (maybe 90% stocks and 10% bonds/cash, or something similar, though I probably wouldn't go all the way to 100% stocks), because you have lots of time to recover from bear markets along the way.
However, you don't want to invest so aggressively that you panic during down markets and end up selling at or near bottoms (and locking in the losses) and then waiting until the ensuing bull market has clearly taken hold and then getting back in, often at or near a top. This is a great way to lose money over time since you are buying high and selling low, but this happens to a lot of individual investors. So if you are the type that is prone to panic and make emotional decisions when it comes to your investments, then you may want to take a more moderate allocation (maybe 75% or 80% stocks and the remainder in bonds/cash). Without knowing you, or your situation, it's impossible for me to suggest an allocation, but these are some of the things to think about.
The key is to find an allocation that will help generate enough returns over time to help you reach your goals, but not expose you to so much volatility along the way that you panic and make bad decisions at the wrong times.
As far as the types of bonds, there are US-issues bonds, corporate bonds, municipal bonds (issued by a state or local government entity), junk bonds (low rated bonds that tend to have a higher risk of default, but usually offer a higher return as well). Bonds come in long-term (generally 10+ year term), intermediate term (usually 3-10 year term), and short-term (usually 3 year or shorter term). The shorter the term, the less sensitive to interest rate changes the bond will be (as interest rates increase, the price of existing bonds decreases, and as interest rates decrease, the price of existing bonds increases). There are callable bonds, convertible bonds, and other types of bonds, but the above are going to be the main types.
You can get exposure to bonds through mutual funds and/or ETFs. In fact, it would be very difficult for someone not working with large amounts of cash to build a well-diversified bond portfolio buying individual bonds.
Ultimately, I would probably suggest building a well-diversified, properly allocated portfolio of stocks and bonds using ETFs and/or mutual funds.
Hope this helps, and best of luck.
WalletHub Answers is a free service that helps consumers access financial information. Information on WalletHub Answers is provided “as is” and should not be considered financial, legal or investment advice. WalletHub is not a financial advisor, law firm, “lawyer referral service,” or a substitute for a financial advisor, attorney, or law firm. You may want to hire a professional before making any decision. WalletHub does not endorse any particular contributors and cannot guarantee the quality or reliability of any information posted. The helpfulness of a financial advisor's answer is not indicative of future advisor performance.