Make your own .sty files

Here is a skeleton for an own package:

% this is my first package
% 
% (c) Buffalo Bill
%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN archives
%% in directory macros/latex/base/lppl.txt.
% 
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{mypackage}
  [2011/01/11 v0.01 LaTeX package for my own purpose]

\RequirePackage{whateverwe need}
\newcommand{\hi}{Hello, this is my own package}
\let\myDate\date
\newcommand\GoodBye[1][\bfseries]{{#1Good Bye}}

\endinput
%%
%% End of file `mypackage.sty'.

Package files are just input literally, so you can use any command that you can use in document files. Most often it makes sense to include a small amount of identification metadata, to support options, etc.; see clsguide.pdf (texdoc clsguide) for a good introduction.