You'll need some form of wireless internet. An access point.
Examples:Wireless Router
WiFi USB thing
WiFi Access Point
You connect your modem to a wireless router, and your Nintendo DS can pick up the signal and use it to connect to the internet using WiFi.
Nintendo used to sell a WiFi thing on their website, but they don't anymore. I wouldn't have suggested it anyway. It didn't work with my computer. But there are 3rd party WiFi USB things that work better. Edit: You connect the USB thing to a USB port on your computer, and it emits a wireless signal that the Nintendo DS can receive.
If you can find a free WiFi access point, you can connect to the internet from there. McDonald's used to have one, because of a deal with Nintendo, but I don't know if they still do that.
If you can connect to the internet:To connect to other people, you need a friend code. To get a friend code, go to your town's Gate. Talk to the dog on the right, and ask about a friend code. You have to be able to connect to the internet using WiFi to get your friend code. Once you have your friend code, write it down (you can talk to the dog at any time to get your code again if you forget).
Then, trade codes with other people, enter their codes in your friend list (it's in the menu under the "heart" section). You can't play with others unless you both have each other's information (Name, Town, Friend Code) accurately registered.
Once you've got everything registered, you can visit their town and/or they can visit your town. You both have to be playing, of course. Also, the person receiving guests must open their gates, otherwise, they cannot receive visitors.
Other notes:Using Wi-Fi, regardless of whether or not you have a visitor (such as opening your gates and leaving them open) will cause the power light on your Nintendo DS to blink (it doesn't mean there is anything wrong). Also, using Wi-Fi will drain your battery faster.
If this doesn't help, or isn't specific enough, try looking
here.