Since your friend code differs between games, it's in different places in different games.
Mario Kart DS: Wi-Fi Connection -> Friend Code
If you don't get a friend code, you have to connect to Wi-Fi first.
Tony Hawk's American Skateland: I don't own it, but it'd probably be somewhere in a menu. I doubt it's a character in-game you have to talk to.
Animal Crossing Wild Word: Talk to Copper in the town gates, then select Friend Code.
If you don't get a friend code, open your gates for Wi-Fi even if no one's coming over, then talk to him to find it.
Tetris DS: Definately should be in the menu.
Same thing applies, if you haven't connected, do so then check.
Metroid Prime Hunters: Multiplayer -> Wi-Fi Connection -> Settings -> Add Friend Code. Your friend code should be displayed there.
Star Fox Command: Should again be in the menu.
It would have been easier if you specified which game you needed to find your friend code on.