Bonds are loans from you to a company or government. There’s no equity involved, nor any shares to buy. Put simply, a company or government is in debt to you when you buy a bond, and it will pay you interest on the loan for a set period, after which it will pay back the total amount you purchased the bond for.
But bonds aren’t entirely risk-free. If the company goes bankrupt during the bond period, you’ll stop receiving interest payments and may not get back your principal.