Hello World Craft Plugin
Apart from reading the docs on plugin development, I would suggest checking out a plugin called Business Logic, which provides a plugin template for creating project specific business logic, with a basic controller, service, and variables file already set up, and doc blocks which explain what the various components do.

For just printing a string I would look into creating a custom variable in your plugins 'variable' file. If the method is more complicated then you can use your variable as a wrapper to call one your service methods defined in your plugin's 'service' file. Here is an example variables file, with a call to a service method:

&lt;?php namespace Craft;

class MypluginVariable
{
    // return the result directly
    public function exampleVariable()
    {
        return 'Anything you want!';
    }
    // call a service method and return the result
    public function exampleServiceMethodWrapper($value)
    {
        return craft()-&gt;myPlugin-&gt;myServiceMethod($value);
    }

}


You could call these from your template using {{ craft.myplugin.exampleVariable }} and {{ craft.myplugin.exampleServiceMethodWrapper('customValue') }}. These are assuming you want to just print the result of course.

The contactForm plugin that you are looking at is interacting with the plugin through the hidden form field &lt;input type="hidden" name="action" value="contactForm/sendMessage"&gt; which directs craft to submit the form to the contactForm's actionSendMessage() method defined in the plugin's 'controller' file. See controller docs for more info.

Fyi {{ getCsrfInput() }} is a native craft method so won't be in the plugin.