Step 1: Locating an Addon's XPI File
NOTE: Some addons require a license agreement to be accepted beforehand. In that case, the XPI file can be saved from the button on the license acceptance page, and not the addon page itself.
Instead of just clicking the button and having Firefox take over, right click and choose "Save Link As...". Once the file transfer is done, you will have the addon package right on your computer.
Step 2: Extracting XPI File
With these files present, you're ready to move on.
Step 3: Extracting the Main JAR Code
Step 4: That's It!
Always respect an authors work, and make sure they allow you to use their code. Don't just take a popular addon, change the credits, and rehost it. That is just simply stealing.