First off - can you 'see' this router if you click on the wi-fi icon in your task bar ? If you can, then normally all you need to do to connect is click on the SSID, and on 'Connect'. If it is secured, like your friend's, then you will need to type in his access key - WEP, WPA-PSK or whatever - and you should connect.
As this key is a case-sensitive password, you need to type it in exactly correctly, otherwise it will not connect. Without his access key, you will not be able to connect. Once you have connected to it by correctly entering the access code, you will be asked if you want to connect automatically. If you now click on 'Yes', the next time you are at your friend's house, you will find yourself on-line without having to repeat this process.
If you can't see your friend's router, but he can connect, it may be that it is set not to transmit the SSID. In which case ask him if he can change this setting to 'Transmit SSID' so that your computer can 'see' it.