Sunglasses are the one accessory that sits right in the middle of the most-looked-at part of an outfit. The frame draws a shape across the face, and that shape either repeats the lines already there or sets up a contrast with them. Most advice about "the right pair" comes down to that single choice.
Look at the outline of your face first. Is it mostly curves, with a soft jaw and a rounded forehead? Or mostly straight lines and corners? Opticians usually sort faces into four loose groups: round, oval, square and heart (wider across the brow and cheekbones, narrower at the chin). Most real faces sit between two of these, so treat them as a starting point rather than a verdict.
The rule of thumb is simple. A frame with strong angles next to a curved outline gives contrast, and so does a rounded frame next to a face with corners. A frame that copies the outline adds more of the same. Neither is wrong; contrast is just the easier route to a pair that looks balanced.
A well-chosen shape in the wrong size still looks off. The size that matters most is width. As a rule of thumb, the front of the frame should be about as wide as your face at the cheekbones, or up to around 5 mm wider. Narrower than that and the arms press in at the temples. Much wider and the frame starts to look borrowed.
To measure, hold a ruler straight across your face at the widest point of the cheekbones, in front of a mirror, and read it in millimetres. Then check the three numbers printed on the inside of the arm, such as 52-18-140. They are the lens width, the bridge width (the gap over the nose) and the arm length, all in millimetres. Two lens widths plus the bridge gets you close to the front width, but rims and hinges add more, so use the maker's listed front width when there is one.
Shape sets the mood. Width decides whether it sits right.
Repeating the outline is a real style choice. Round frames on a round face read soft and retro. A rectangular frame on a face with corners reads sharp and architectural. If that is the look you want, pick it. The contrast rule is a way to get a balanced result without thinking; it is not a limit.
Your wardrobe matters too. A thin metal aviator suits a lot of outfits without announcing itself. A bold cat-eye or an oversized rectangle is the loudest thing in the look, so keep the clothes quieter around it.
The picks below are examples in each spirit, at different price points. Trying a pair on in a shop before buying is the best test of all.