Minetest has rebranded! You may see the name Luanti appear on this page! This is because Minetest is now Luanti
Depending on the game that you want to create a mod for, the code, file structure and functions are different. A good game to try modding is Minetest. Minetest is a free opensource game that is downloadable on GitHub! Minetest mods are coded in language called Lua. A good place to start is to try coding some custom commands into the game! If you then develop a unique and useful mod, you can get it published on the Minetest content DB.
Some useful links:
https://www.minetest.net/ (The official Minetest website)