1—Discourse is the use of language (written or spoken) in a social context. It is how people share ideas, build relationships, and communicate. Example 1: Ahmad, give me this book for an hour.
2—Pragmatics focuses on how meaning is constructed in a specific context or how a context affects meaning. It is related to cultural norms and society. Example 2: Sir, Could you please give me this book for an hour?
Pragmatics is all about Saussurean, Sign, Signifier, and Signified happening in the text and context. Whereas, Discourse Analysis, DA, has been an analytical or discursive part of its social realization through, Spoken and Written framework in LSRW and It also investigates philosophy and functional language (Sign includes), linguistically or through extensive literary context, structure, and statement.
Discourse Analysis is a research for studying written or spoken language in relation to its social context. It focuses on how you say it rather than what you say. Ex: The chair of governors think.. . We understand that "chair" refers to the person who presides over a governing body.
Pragmatic is focuses on how we understand the hidden meanings in what people say. It's about the unspoken rules of conversation. Ex: Do you have the time? We understand that it means “Could you tell me the time?” The implied meaning is that the speaker wants to know the current time.
So you can think like; Pragmatics is like studying a single word in a sentence. Discourse Analysis is like studying the entire sentence and how it fits into the paragraph.
To my knowledge, discourse analysis (also named "conversation analysis") focuses on the ways discourse is built up between conversation participants. So it focuses on contextual and extra-contextual elements (words, discourse markers, politeness, environmental situation, relationship between the interactants, etc.). You may also consider pauses, non-words ("hmm", "oh-oh", "erm") as relevant in discourse analysis. Pragmatics, conversely, focuses on the real meaning of words. It can be considered in discourse analysis. For example, when entering a room, saying "it's pretty cold in here" actually means "can someone close the window or turn on the heating?", but you are not saying it too directly because it could be considered as impolite.
It depends on how you approach pragmatics. With some linguists it is a linguistic discipline but with some it is just a perspective cutting across all the levels of language representation. Cf. e.g. Understanding Pragmatics by Jef Verschueren (1999).
Actually these two paradigms overlap. But pragmatics seeks to answer the questions 'WHO says this?' and 'WHY?'. And DA focuses on the question 'WHERE?' but does not ignore the questions of pragmatics, which causes overlapping.
Pragmatic is complementary to the realism and pluralism paradigm as a worldview, overlapping its meaning for any integrated study's outcomes. This paradigm is a type of strategy, which integrate the results of study in language - in use for narrative and conversation discourse analysis, focusing on How it is Used rather than What is Said. The goal of pragmatists is to explore how language is utilized in context to communicate meaning beyond its literal and theoretical meaning. In addition, examine and integrate various functions and factors, including, social identities constructs, power relations, cultural values, social reality, body language, and more. Pragmatists can view, integrate, and explain their results through the lens of narrative and conversation discourse analysis.