You need to add Friend Codes by tapping the smiley face on the top portion of the touch screen of the home screen of the 3DS. After you do that, you will have access to the Friend Safari. Simply choose the safari you want to enter and you can enter and catch up to 3 Pokemon, assuming the person who the friend code belongs to beat the elite four. If not, then the person will have 2 Pokemon.