Making a custom module in Drupal can be as easy or difficult as you would like it to be. For the purpose of the post we will be making a simple module in Drupal that you can use to alter forms.

Step 1
Make an info file for your module call it mymodule.info and rename the "mymodule" to whatever you will be calling your module.
In the info file you can put various items, but the only thing you will need is the following:

Drupal 5.x

// mymodule.info
name = "mymodule"
package = "My Modules"
description = "Put Description Here"

Drupal 6.x

name = My Module
description = "Put Description Here"
core = 6.x

If you plan on publishing this module you can put additional information in the file.

Step 2
Make a module file called mymodule.module and once again rename "mymodule" to your module name.
This module is going to be to alter forms so we will put the following code in.

Drupal 5.x

<?php

// Hook Form Alter
function mymodule_form_alter($form_id, &$form) {
  // do stuff
}

Drupal 6.x

<?php

// Hook Form Alter
function mymodule_form_alter(&$form, $form_state, $form_id) {
  // do stuff
}

Put the two files into a folder with your module name, mymodule, upload it and enable it on your site.

More documentation about what you can do with modules can be found at the Drupal API reference site.