Plugins are the best way to extend QGIS, as they can be easily updated and reused by other people.
The easiest approach to creating a plugin is to use the Plugin Builder plugin to jumpstart development. You can find it in the main QGIS plugin repository and install it.
Perform the following steps to create a simple plugin that displays a dialog box with a custom message:
A demonstration on building a QGIS Plugin.
mypluginfor the Module name.