Well, if it's installed as a 'debian source' package, the debian build scripts will take care of everything. Otherwise you need to build the software to install to a local directory (but with internals set to look in all the right places for config files and so on), create your own control files, pre/post-install/remove and so on and ask the packaging tools to put everything together. Depending on your skill level it may take a bit of getting used to, so I'd suggest:
1. Create packages which only install a single file in some simple place like '/tmp' - make sure your install and remove scripts work well.
2. Install the debian-source for a relatively simple package (let's say 'pppd') and have a good look at the various debian packaging files that come with it. Make sure you can understand what those files are doing.
3. Go ahead and build your software and create the debian packaging files then create a useful *.deb package (as opposed to what was done in (1) which is only to get comfortable using the tools).
Have a look at this article on TLDP: