Start by slicing your onions and slicing the garlic into fine pieces. Try to get these as uniform as possible.
Bring the sugar, salt, celery seed, water, vinegar, mustard seed, and turmeric to a boil in a large pot.
Once boiled, add in the onions and garlic and stir until all ingredients are thoroughly heated through.
Remove the pot from the heat.
Clean and heat your canning jars, then ladle the pickle mixture into the jars, making sure the onions are covered by ¼ inch of liquid.
Leave ¼ inch of headspace between the top of the liquid and the lid.
Use a bubble remover tool to release any trapped air, then wipe the rims clean. Center the lids on the jars and screw on the bands tightly.
Process pint and half pint jars for 10 minutes (or 15 minutes if above 6,000 feet in elevation). Quarts are processed for 15 minutes (and 20 minutes above 6,000 feet elevation). Once the time has completed, turn off the heat and remove the canner's lid.
Allow the jars to rest in the water for five minutes before removing them and placing them aside to cool for 24 hours.
Check the seals, and if your jars are properly sealed, store them in a cool, dark place for up to one year.