Java is a supporting feature of certain web sites that are not accessible, nor compatible with many web browsers.
http://www.java.com will tell you if you can upgrade the Java on the browser in question.
If not, just let websites you want to visit know, they need to consider using HTML5 which is more usable by more browsers than any other.
The only reason to upgrade your operating system is if all your documents can be read by programs that are usable on the new operating system or you need the new operating system, and you can afford the hardware for the newer operating system.
As you'll see, you need a 2012-2015 or later Mac to run 10.15, a 2013-2015 to run 11.0, and 2013-2016 Mac to run 12.0 depending on the model. Just go back to my browser link, and click on each OS link to find the system requirements.
10.15 requires you to upgrade to all 64 bit applications and drivers.
At least through 12.0 if you are compatible that's really the major hurdle. As with any upgrade, you need to backup your data, and test the upgrade first to make sure everything is working and compatible.
Your hard drive will work with any OS you desire. Just make sure it is formatted for the lowest OS you plan to use it on. HFS Extended GUID with Disk Utility will maintain compatibility with 10.11 and later OSes.