Recently, a friend and I were talking about worldbuilding, and then the other day we went to Bath. These things are related because I find Bath to be a good visual metaphor of one thing we'd been discussing: keeping a consistent feel in the world you've created. Bath feels like a world of its own because of the Bath sandstone. For anyone who's never been there, the whole city is a historical site, and virtually every building is at least paneled in sandstone of the same color. It's as if the whole city were carved out of one big rock, or all splashed by the same (pale yellowish) paint. This is despite its having Burger Kings and Indian restaurants packed in with art galleries, modern and classical, tourist shops, the Baths once frequented by Romans and the Assembly Rooms visited by Jane Austen.
Naturally, any well-crafted fictional culture - or even any single city - is likely to have diverse populations and institutions and remnants of various historical periods. This can add richness, but the culture does need to be drawn together by common elements or risk seeming random and poorly-conceived. If, for example, a fantasy world contains characters named Aletha and Hedric and also characters named Terry and Doug, supposedly from the same place and with similar backgrounds, the world will seem inconsistent. (This is worse when half of the characters in one culture have generic old British names such as Will and half have names the author made up that are filled with Xs and cannot be pronounced without years of training and possibly a second tongue. Do not speak to me about apostrophes.)
This is a funny problem because, as often happens when fiction imitates real life, the fiction must make sense in a way that reality sometimes doesn't. Obviously, most people do not have to be convinced that something could work in an unlikely way if they actually see it working that way. A real-life culture that seems to lack coherence is not seen as "unrealistic." Still, that doesn't mean you can get away with it in your worldbuilding.
So, how to do this? A lot of generic medievalesque fantasy writers do it without much difficulty simply by basing their worlds on Britain at a certain time period. There's nothing wrong with that, assuming the story, characters, and writing are good. One of the continents in my fantasy world was created basically that way. Things can be more difficult when basing a culture on another real-life country just because it's done less, so people are less sure how to take it. You don't want to create a race or civilization that seems like an offensive stereotype of a real people - think of some of the criticisms of certain Star Wars aliens.
Naturally, you want to do as much creation as possible going forwards rather than backwards - that is, thinking, "What would logically proceed from this?" rather than, "How can I make this thing happen?" You can certainly work with the latter if you have one or a few important traits you want in your culture and are flexible on the rest. For example, if you want to write a fantasy plot that involves a lot of sea travel, then you must create at least one civilization that possesses ocean-going ships or other means of transport. This is not a problem. If, say, you're also determined that this civilization lack a technology common to the rest of your world, then you have to account for why travelers and traders using their port have not introduced this technology. Things become more complicated. If you put too many demands on a civilization before you create it, you can build yourself into a corner. If, on the other hand, you simply start with what the people would have had (say, a coastal area at the mouth of a river in a warm climate, with rich soil), then you can make your culture from there in a way that makes sense. Depending on how you do it, this can mean a lot of research, but you can borrow from existent (or historic) cultures that shared similar features - your civilization might do things in a different style, but is likely to develop similar kinds of technology, practical clothing, and so on. You do have to be careful that you don't borrow something that in reality was caused by a factor your world doesn't have: Religion will trip you up here, because it is behind so many traditions and may not be the same as the beliefs in your world. You also have to keep in mind things that your world has and reality doesn't that could have affected the culture's development. If there is magic, for example, or if multiple intelligent species coexist, that should be accounted for.
If you're not writing fantasy or science fiction, you may have an easier time because a civilization more similar to reality will have more things you can just assume. If you are writing fantasy or sci-fi, here are a few things you might consider to keep each culture you write consistent.
1. Names. This does not have to be a pitfall - it can be an opportunity. Names can be a great way to establish differences between cultures - you just want to be consistent within each culture. One way to do this is to adapt (or blatantly steal) names from different languages. It's a silly example, but if you have characters named Marcus and Furianus who meet someone named Elizabeth, the names will draw a stark cultural line between the two groups. Obviously, a fantasy world could be a place where a civilization exists that encompasses both names, but it would be hard to do something like this well. Similarly, if you make up all of your names, try to make them sound consistent - you might want to think a little about the sounds of the languages your people speak.
2. Dress. What is the climate of this civilization like? What are common occupations? What materials and dyes are available? Do certain colors have religious or societal significance? Maybe only mages wear red, only royalty wear white, or purple is worn only in mourning. Remember also that people in different places may come up with different ways to solve the same problem due to their varying resources and beliefs.
3. Speech. If you have a character who is not speaking his/her first language, how might that affect word choice and order? Even if everyone speaks the same language well enough for it not to matter, some people may have traditions of speech - being more formal, for example. Consider also things that go along with speech: accents, hand movements, and possibly other gestures such as bowing.
4. Supernatural Elements. If your world has magic, it may not be the same kind all over. Even if it is, it may not be regarded the same way everywhere. Like technology, certain kinds of magic may be more advanced in places where they are more practical: Agricultural magic in a farming area, for example. Magical creatures, too, may be approached differently by different societies. Maybe one culture reveres dragons, another hates and fears them, and another has never heard of them.
You can add to the coherence of your fantasy civilization through many other elements - architecture, manners, traditions, beliefs - but the above are ones that seem especially likely to come up and may involve less research than some others. Not everyone wants to think about things like architecture. Consistency is important even if only one culture appears in your story, and it is sometimes easy to slip. Still, it can be very rewarding to build a culture in detail, and it may lead to more story ideas!