If you have a failover tool like EDB EFM,repmgr or others then it will automatically take care of promoting the standby to master and reconfiguring old master as new slave when you do a switchover.
If you don't have such tools then you can manually promote the standy to be the new master and run a pg_rewind on the old master to sync with the new master. If pg_rewind does not work then you will have to rebuild the old master using pg_basebackup.