Insert your retail cartridge and boot into gateway menu using the profile exploit. (Settings -> Other Settings -> Profile -> Nintendo DS Profile)
Scroll over to Backup 3ds Game Cartridge & do that.
Once done, turn off the N3ds & take out the mSD behind the backplate. Connect it to your computer and remove the game you just backed up.
Launch Gateway
Rom Patcher v1.1 - Load rom - Extract Header to File - save file to computer
Check the change to .3dz option if it's not.
Load the rom you want to go online with.
Import Header from file *The file you exported and saved*
Apply & accept any popups.
Your loaded rom will now be .3dz & have your private header injected. It is now online ready.
You could use the Sky3ds to play games online as well, but it's a fair bit more of a hassle to use imo.
*If you have saves for any game you are going to inject a header into, you'll want to download SaveDataFiler.cia & install that and back them up, they won't work once you inject the header until you import the backups from SaveDataFiler*