Wash the cucumbers, trim the ends, and slice them into spears or rounds.
Pack the cucumbers tightly into a clean quart-size glass jar.
Add the garlic, fresh dill, peppercorns, mustard seeds, and red pepper flakes (if using) to the jar.
In a small saucepan, combine the white vinegar, water, kosher salt, and sugar.
Warm over medium heat just until the salt and sugar dissolve. Do not boil.
Let the brine cool for a few minutes, then pour it over the cucumbers until they are completely submerged.
Seal the jar tightly and gently shake to distribute the seasonings.
Refrigerate for at least 24 hours before serving. For the best flavor, chill for 48 hours.