In Star Trek, Starfleet uniforms and other clothing is made by replicator patterns. Not only does this suggest a standard pattern as well as standard sizing considering the variety of body types that we see. So why are tailors like Garak even a thing? What can Garak do that a replicator can't?
First, if you have watched Deep Space Nine thoroughly, you know that Garak is much more than a simple tailor.
But that said, you are right: In theory, you can program a replicator to make the exact clothing you want. But as some people prefer "real" food over replicator products, some people probably want real clothing made from real cloth. The reasons for this often are subjective and irrational.
I also presume that a lot of people lack the replicator programming skills to make clothing as convenient as a professional tailor could do. This brings to mind the Star Trek Voyager episode "Shattered", in which Kathryn Janeway failed to program her replicator to make a proper pot roast.
Tailors usually also have a sense for contemporary fashion, which replicators don't.
And maybe there are some rare fabrics which just cannot be replicated for technical reasons, so you would need a tailor to acquire and process them.
The following is non-canon, but it looks like the producers of DS9 assumed that the dilemma tailor vs. replicator isn't completely solved in the 24th century:
A deleted part of dialogue from the episode "Move Along Home" says that Bashir wanted Garak to make him a new dress uniform. Dax responded that a replicator would be better than a Cardassian tailor.
Source: Memory Alpha
Tailors exist in Star Trek for the same reason tailors exist in real life.
Both replicated clothing and real world clothing are made from patterns. Bodies, however, are not made from patterns.1
Custom tailored clothing is more comfortable because it's adjusted to fit the individual. It can be designed in such a way as to minimize or enhance the appearance of certain physical traits - a well tailored suit can make a person look slimmer and more fit. Clothing based on patterns has to make assumptions about the wearer's shape that custom-tailored garments do not.
There's also a certain amount of prestige in owning custom tailored items - they're custom after all, that means more time, money, or expertise went into making them.
Garak appears to do most of his work by hand, cutting and sewing raw cloth. It is entirely possible that some "tailors" work digitally, taking a scan of the customer and using that to rework the baseline replicator pattern to something more suited to the specific customer.
1Transporter "patterns" don't count. They're made uniquely each time and only used once.