I will make it very simple sweet and short. No long boring text. Just to the point.

Lets start!

Magento 2 only need two files to register and initialize a module.

  1. registration.php: This file is located in the root directory of your module (app/code/Anees/Training/registration.php). It uses a Magento function to register the module with the framework.

  2. etc/module.xml: This file is located within the etc folder of your module (app/code/Anees/Training/etc/module.xml). It defines the module's name, setup version, and any dependencies it might have.

After adding above two files run command bin/magento module:enable Anees_Training

Remember this is just a start. Magic will happen later when you go to advance level.

You can get this module from here.