Those terms come from a long debate on education and its objects of study as an academic area. In short, and it may be simplistic, both refer to the teachers' and their institutions' work. "Pedagogy" usually means the labour of teaching globally educating in values and activities in general, through discourse and through modelling and example. "Didactics" usually has a more restricted meaning, related to the study of learning and teaching specific areas, abilities or skills.
Nowadays, they seem to be subsumed to the study of teacher's work, performance and competences, and in the study of teaching reasoning, guided usually by paradigms like “didactic transposition” or “pedagogic-content knowledge” (ways in that teachers use and combine their knowledge in the subject with the best activities to teach its concepts).
I add to the previous reply: Pedagogy involves the application of theoretical pedagogical models to students. However, since the 1970s, this perspective has been surpassed by the Educational Sciences, which utilize Action Research as an intervention method. In this approach, the process begins with the observation of students and classroom dynamics. Subsequently, hypotheses and interventions are formulated based on these observations. The uniqueness lies in the fact that these hypotheses and interventions are not merely theoretical but undergo validation through practical implementation and the collection of concrete data. The Educational Sciences focus on the practical application of pedagogical theories, aiming to enhance the effectiveness of teaching through a continuous cycle of observation, reflection, action, and evaluation.