I encountered this behavior from LaTex: last definition from section 2.1 was labeled (correctly) as 2.1.8. Then, the first definition of the next section was 2.2.9. I would like it to be 2.2.1 (don't know the standards but that makes much more sense to me). I found this question which is kinda relevant but works with theorems and not definitions.
The only commands(I think) that modify somehow the definitions are:
\newtheorem{definition}{MyDef}
\renewcommand{\thedefinition}{\arabic{chapter}.\arabic{section}.\arabic{definition}}
So, how do I change it? Thanks in advance.

\newtheorem{definition}{Definition}[section]should work as expected and number youd definitions as follows: "chapter.section.definition" while the definition counter starts from 1 with every new section. – leandriis Oct 17 '20 at 11:51