How to save your contacts on your Google account.
Log in to your email account
Go to your Contacts, under contacts, go to settings
Under settings, click on Google, it will automatically synchronize it. That's, it will save all on contacts to your Google account.
So when you change your phone, just login to your Google account, and it will show all your contacts on your phone.
For your Whatsapp
Go to download whatsapp on your play store
Type the number you used to open it before,
I guess it will send code to that number, once you type that code, it will lead to your previous whatsapp messages, with all your chats