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'.
You can put mypackage.sty
in the same directory as the .tex
file, into ~/texmf
, or somewhere else in latex's package search path—see $ less "$(kpsewhich texmf.cnf)"