Figuring out the "how" is the hard part.
Fortunately, for you, I've done the hard part.
The main problem is to do with a command "emerald --replace" which must be always running to enable Emerald themes to be used. There are a lot of guides and forum answers out on teh inter00bs that suggest adding the command as a "Startup Application" in System > Preferences. That doesn't work. Some other guides reckon you need something called "fusion-icon" running in your notifications tray. That may work too but it is not necessary.
Here's what to do.
* Ubuntu or Debian desktop, I'm using Lucid x64 but that's not important.
* 3D graphics driver with Compiz enabled and working.
We'll start off by installing some packages;
sudo apt-get install emerald compizconfig-settings-manager
Open Compiz Settings Manager;
System > Preferences > CompizConfig Settings Manager
Click the "Effects" category
Ensure "Window Decoration" is ticked and then click it.
In the "Command" text box, take note that it currently says;
Change the text so that it says;
And that my friends is the secret sauce to get things working properly!
To disable Emerald, simply return to here and click the "brush" icon at the RHS to restore the default setting
You can now exit compizconfig-settings-manager.
You will need to restart your X server at this point. The easiest way is to just restart the machine.
OK, once you have booted up again browse on over to
http://compiz-themes.org and grab yourself a theme.
With theme in hand, open the "Emerald Themer" application;
System > Preferences > Emerald Theme Manager
Import your theme using the "Import" button.
Once it's imported, the theme will appear in the theme list. Simply click it and watch your window decorations magically change.
Easy? Well, it should be.