Before answering this question, let’s establish that there is a difference between a wine being bad, and simply not liking the wine you ordered. Telling a server a wine is flawed when you actually just don’t like it is like telling them you have an allergy to mushrooms when funghi just isn’t your thing.
If you don’t like the wine you ordered for whatever reason — the flavors, the body, the level of acidity — be honest with your server. Most servers will find you another bottle and find another use for the wine you didn’t like — for example by pouring it by the glass as a special, or sharing it with the staff at the end of the night.
If, on the other hand, you think the wine actually has a flaw, but you aren’t sure, ask your server or the sommelier to taste the wine as well. At high-end establishments, often the somm tastes the bottle before even bringing it to the table, helping to ensure it’s tasting the way it should. But if you’re at a restaurant where the bottle was opened in front of you and you are the first taster, there is nothing to be ashamed of in asking for help or another opinion.
Tell the server you think there is something off with the wine, and do your best to describe it for them. Maybe you think it tastes like stewed prunes, a sign the wine could be oxidized; or it has a cardboard flavor, an indication the wine is corked. If the server or somm also tastes the flaw, they will replace the bottle immediately.
There is a chance, however, that the wine isn’t flawed, and the somm or server may tell you that this is indeed the way the wine is supposed to taste. In that case, tell them it’s not a wine for you, and ask them to recommend another bottle. No one should drink a wine they don’t enjoy.