A Friend Code is a number on your Nintendo DS or Switch. If someone else inputs it, they are able to friend you and you can do things together or find each other more easily online. The Friend Code section is a place for you to put your codes if people want to friend you for any reason or another. It doesn't just have to be Friend Codes, though. You can put other contact information or usernames in the box, like your Showdown! accounts or your Discord name.
Tl;dr the Friend Code section is intended for your Nintendo FC, but you can put pretty much anything you want in it, like other online accounts (Discord, Showdown, etc.).
Hope I helped!