There are two possible types of homebrew on the 3DS: ARM11 userland and ARM9.

ARM11 userland homebrew is the type we're going to cover in this section of the board. Basically, ARM11 userland homebrew runs in the same environment as commercial games. This environment gives enough privilege to make interesting homebrew, and is also the most practical.

Here are the possible ways to run ARM11 userland homebrew on your 3DS:

Ninjhax

It is a game-based exploit released by smealum and working on all firmware versions from 4.0.07 to 9.0.20.

Gateway

It is a flashcard that is made for piracy purposes but also supports running homebrew.

If you want to go this way, be warned that their launcher contains code that has a 1/16 chance of bricking your 3DS if it detects that Launcher.dat has been modified. Make sure to acquire a genuine Gateway and to get the launcher from their site.

Accidental corruption of the launcher has more chances of resulting in a simple crash, but always make sure that the file's MD5 hash matches the hash posted on their site's download page.

We take no responsibility if your 3DS gets bricked. You were warned.

Before acquiring a Gateway, make sure that your 3DS firmware version is comprised between 4.1 and 9.2.

If your firmware version is too old, you can update by running a game that embeds the desired firmware version, such as Animal Crossing. Do not update via the System Menu.

There are some faults:
-NINJHAX works from 4.0.0-7 to 9.2.0-20.
-GW currently only works from 4.1.0-4.5.0 and we do not know when it changes.
-MT-Card supports 3DS mode homebrew (CIA and 3DS) too and I don't know about R4i Gold, Orange 3DS and 3DSLink.