Basic Module Tutorial or Example
I haven't tried this tutorial yet, but having learned a lot about Craft 3 from Andrew Welch's other tutorials, I don't doubt this may have some nuggets of useful information to get you on your way.

https://nystudio107.com/blog/enhancing-a-craft-cms-3-website-with-a-custom-module