If you mean the DS titles like Nightmare Troubadour or World Tournament 2007, Nintendo's Wi-Fi support pages have the connection FAQ you need.
Free programs handle it well. YVD (Yu-Gi-Oh Virtual Desktop) is the one most people recommend — you can build any deck from any card and duel others online, and new cards tend to appear within a month of their real release. It takes a little getting used to, and card images have to be dropped into the right folder by hand. — Dragonheart91
There's also https://yugiohnetwork.com, which runs in the browser with nothing to install and has an English version.