Getting a new MacBook. How to transfer my existing data?

Except for media (mp3, movies, pictures etc) which I can just copy on an external storage and paste it in my new MacBook, how do I go about basically 'resuming' work on the new one from where I left off on the old one? Can I use any random external HD for time machine backup? And what exactly does it backup? Will I get all my apps back exactly the way they are on my existing MacBook? This includes keychain passwords, browser history and bookmarks.