Download the Sourcerer Plugin

Go to the Joomla Extensions Directory and find Sourcerer: http://extensions.joomla.org/extensions/edition/custom-code-in-content/5051
Click on the "Download" link and you'll be taken to the developer's website where you can download Sourcerer.
Upload and Install Sourcerer

In the Administrator area of your Joomla site, click "Extensions" then "Install/Uninstall". Click "Browse" to find the Sourcerer plugin and think click "Upload File & Install"
Create a New Article

Click "Content" then "Article Manager" and then "New"
Scroll to the Bottom of the Article

Click on the new "Insert Code" at the bottom of the article.
Pop-Up Box

You can write your code directly into this box. Just make sure that code has the normal opening and closing tags. When you're done, click "Insert" in the top-right corner.
Save the Article

Don't make any changes to the code you've created. Save the article with the editor turned on and all the code in between the opening { source } and closing { /source } tags.