Upgrade and update from version 13 to version 16

I want to upgrade my ERPNext system from version 13 to version 16. I also have custom apps and client scripts. How can I perform the upgrade so that everything continues to work properly without affecting future functionality?