Place sliced cucumbers in a colander set over a bowl. Toss with salt and let rest for 20 minutes to draw out excess moisture.
In a large bowl, whisk together minced garlic, red wine vinegar, sugar, olive oil, and black pepper until sugar dissolves.
Pat cucumber slices dry with paper towels to remove as much moisture as possible.
Add cucumbers, dill, and red onion (if using) to the dressing. Toss well to coat evenly.
Cover and refrigerate for at least 30 minutes before serving to allow flavors to meld. Stir once more just before serving.