To enable the Module Dependency, Click on Advance Option and select Managed course.
In the list of the courses which you are creating, go to the course for which you want to enable module dependency and select View as Editor Icon.
To know which module to be completed, hover over the Module dependency tree icon at the right bottom corner of the module, which will display the predecessor module which is to be attempted first.
In the course page, click on the last icon of each module which will ask for predecessor module.
Select the predecessor module and Submit. This means the user has to complete and lock the selected predecessor module to attempt the module for which the dependency is created.
After all the selections are done, click Publish Change button to save the changes.
To view the module dependency feature which was enabled, go to the account in which you have enrolled into the course. Click on the course.
Here, you can see Module 1 is only enabled and other 2 modules are not. This means to attempt module 2, you have to complete and lock Module 1 and for module 3, module 2 to be completed.