You should be able to upgrade your laptop to OSX 10.11 El Capitan. Search for "macos" in the App Store to access the El Capitan installer.
I'm currently running OSX 10.10.5 on my Mac without any issues connecting to websites. Of course I'm not using Safari, but Firefox and Vivaldi web browsers. Or are you referring to other software which accesses the Internet? Maybe you have other software issues or settings which are interfering. You might want to run EtreCheck and post the report here using the "Additional Text" icon which looks like a piece of paper.
If you do not have money to get another laptop, then you may want to consider installing Linux on the laptop. While Linux is not for everyone, Linux can greatly extend the useful life of a computer especially if you want to use it for web browsing. Before installing Linux, I would strongly suggest making a backup of your laptop and even create a bootable macOS USB installer first (verify you can boot both).
Ubuntu and Linux Mint are the two best Linux distributions for new users especially on a Mac. I don't recommend the default Ubuntu since it needs a very powerful system to run, but the other Ubuntu flavors (Kubuntu, Ubuntu-Mate) will run well on an older system with 4GB of memory. (Xubuntu and Lubuntu are other options, but have a much more basic look and feel). These other Ubuntu flavors still have the same core/base operating system as Ubuntu, but each one uses a different graphical interface (aka Desktop Environment).
You won't be able to download and run popular software (MS Office, Adobe products, etc.) when using Linux, but Linux does have access to equivalent software usually included in their own repositories (LibreOffice, GIMP, Blender, etc.). You will need to take the time to learn the basics of Linux since it is different from macOS and Windows. Make sure to do your research first so you know what you are getting into.
You can create a bootable Linux USB installer using Etcher (Mac/Windows/Linux). Just make sure to have a bootable macOS USB installer or a bootable backup so you can reinstall/restore macOS if Linux is not for you.