To make changes in the module you just replace the code. For database changes you need to write a patch which will modify your table/tables structure.
Each module has its own /patch directory where the patch should be placed: http://www.epesi.org/Patches
Please get familiar with some patches and you will see how this is done.
Example:
<?php
defined("_VALID_ACCESS") || die('Direct access forbidden');
DB::Execute("UPDATE contact_field SET extra=1");
DB::Execute("UPDATE contact_field SET extra=0 WHERE field IN ('Last Name','First Name','Company Name','Last Name','Email','Login','Username','Set Password','Confirm Password','Admin','Access')");
DB::Execute("UPDATE company_field SET extra=1");
DB::Execute("UPDATE company_field SET extra=0 WHERE field IN ('Company Name','Group')");
?>
This is from: /modules/CRM/Contacts/patches/20120801_essential_fileds.php
The first line:
defined("_VALID_ACCESS") || die('Direct access forbidden');
is to make sure that only admin can run a patch.
The rest are as you can see operations on the database directly - you can execute any query you want.
Patches can be executed from within a custom code, but in general admin tools are used to run all new patches: