/connect chat.freenode.net
/nick nickname

Replace nickname with your desired nickname.

/msg nickserv register [password] [email address]

Replace your email address and password with the values you choose.

You should immediately receive a verification email. Copy the code provided in the email to your irc client.

To log in simply type:

/msg nickserv identify [account name] [password]