Onions store easily. Bon Appetit says onions can be stored in a cold, dark, dry area for a long time.
Red, white, yellow, pearl, tiny pearl, shallot, and cipollini onions are safe to eat if stored in a cold, dark place with air movement.
Some onions need more than a cold, dry area to thrive. Healthline recommends refrigerating green onions (scallions) and leeks.
Green onions are young onions that haven't formed their bulbs, and leeks never do.
Cut onions should also be refrigerated or frozen, according to Bon Appetit. Cut onions should be stored in an airtight container to prevent fridge odours
Freezing onions may modify their texture, but as long as you boil them, it's safe and delicious and will prolong their life for months.