There are two common ways to create an AMI that offer a mix of ease of use and detailed customization levels.
The easiest method involves starting from an existing public AMI and modifying it according to your requirements, as described in Starting with an Existing AMI.
Another approach is to build a fresh installation either on a stand-alone machine or on an empty file system mounted by loopback. This essentially entails building an operating system installation from scratch and is described in Creating an AMI through a Loopback File.
After the installation package has been built to your satisfaction, you must bundle it and upload it to Amazon Simple Storage Service (Amazon S3) as described in Bundling an AMI.