Sociolinguistics, broadly defined, is the study of language use across demographic lines.
It's interested in how this group speaks differently from that group. Gender, socioeconomic status, age, ethnicity, geographic location, and so on are all possible dividing lines.
It's also interested in how these changes come about and how they interact with sociological phenomena (see e.g. "Peaks Beyond Phonology: Adolescence, Incrementation, and Language Change" investigating the classic finding that women tend to lead language change).
It's also interested in the effects that language use has on society. One trivial example is politician soundbites. Never "misunderestimate" the power of a quotable word or phrase!
Pragmatics, broadly defined, is the study of language use in context.
It's interested in the functions of language beyond the mere conveyance of semantic data (though of course that's one of the functions). For example, language can perform certain tasks: the phrase "I vow" is not simply a statement but also an entry into a binding contract with consequences, though maybe less so nowadays...
It's interested in how information is signalled non-literally and what motivates choices about how to do so. For example, you cook a meal for your spouse, the main course being a steak but also with carrots and potatoes. "How did you like it?" you ask. They reply, "...The potatoes were just perfect." You now know their opinion of the steak. How did that work?
It's interested in how context affects meaning. How does a conversational structure work such that the statements are all related to each other (or not — how does a topic change)? How can we formalize our understanding of word-variables such as pronouns and demonstratives?
There is certainly overlap, not least because social phenomena often involve context-embedded uses of language. For example, if language is restricted or taboo for one group (sociolinguistics), they may depend more on implicit discursive structures to communicate (pragmatics). If a word gains a particular value for one group in terms of its social symbolism (sociolinguistics), they may use it performatively, e.g. saying it in a certain context is a declaration of allegiance (pragmatics).
But you can also see that there is a lot of non-overlap available in the two fields. Also, if we're laying out branches of linguistics along a continuum from most basic blocks of meaning to biggest, pragmatics also overlaps backwards with semantics, not only forwards with sociolinguistics.