Combine the brine ingredients (distilled white vinegar, water, granulated sugar, kosher or pickling salt, and black peppercorns) in a pot and bring to a boil. Stir until the salt and sugar dissolve, then turn off the heat and let the brine cool to room temperature.
Place roughly half of the dill and half of the garlic into the bottom of each 1-quart jar. Pack the cucumbers into the jars as firmly as you can, optionally adding sliced yellow or sweet onion if you like, then tuck the remaining dill and garlic among the cucumbers.
When the brine is roughly room temperature (it can be a little warmer or chilled), pour it over the pickles, dividing the peppercorns between the jars, and make sure the cucumbers are fully covered. If you find you don't have enough brine, make more using equal parts distilled white vinegar and water.
Screw on the lids and chill the jars in the refrigerator once they are fully cooled. For best results wait at least 24 hours before eating; the pickles will keep in the fridge for up to a month—ensure they remain immersed under the brine.