Yeah, the server will automatically tell you if a nick is already in use.
But there's also cases where you can't access your own nick (even if you've registered it). It usually happens when you have bad internet connection which makes you disconnected from the chat, but not logged out from the server. Just wait for 5 minutes, and try claiming your nick again. Or, better yet, register as many backup nicknames as possible, so that you can switch quickly between nicknames in case of connection problems.