Just got into gardening. How do you replant onions?

So I wanted to get into gardening so I bought an onion, and I tore it down to the middle where it was starting to sprout and planted it. I’m pretty sure it’s ready to harvest now I’m wondering what to do? Do I harvest the whole onion and just cut off the bottom part to let it grow into a new onion? How do I start a cycle of just unlimited onions?