In a book with chapters and sections, I would like to number (and \label for possible reference elsewhere) the exercises at the end of each section as, for example, Exercise 1.2.3, for the third exercise at the end of the second section in the first chapter. It needs to be "dynamic" so that everything is automatically adjusted in the event that I add other exercises, move sections or chapters, etc. (I've already \labeled each chapter and each section.)
Assuming the sections are already numbered as chapter.section, you should be able to declare
in the document preamble after whatever package you use to set up exercises. Check that package documentation to see if it offers an option to do this by itself.
You can separately control the display of the number and whether the counter gets reset every section by using two separate declarations
for the formatting and
for the resetting.