Welcome to the forum

. I'm afraid I'm going to start with a few questions, since we need to understand the actual situation before we can answer:
What do you mean by "rubbish" and "quickly"? How long does it actually last per charge? There's also a big difference between what you can expect in standby and what you can expect in active use, so it's important to distinguish when answering such questions (time with screen on is commonly used as a proxy for how much it was actively used).
Is the drain mainly happening when in standby or when being actively used? What is your main usage - if for example you play demanding online games with brightness up full then you shouldn't be surprised if the battery goes down quite fast. If you are suffering a lot of drain when not in use, what is the signal like where you are (any phone will drain faster in a poor signal area, especially if it spends its time swapping between 2G/3G/4G as it comes in and out of coverage)?
The S5 is about 3 years old now, so does it still have the original battery? If so then a new battery might help, especially if your friend didn't know how to look after a Li-Ion pack (to maximise longevity do not run it down to zero if you can avoid it. Heat isn't good for them either, so playing intensive apps while plugged into the charger is also not the best way to treat them).
Otherwise, a few off-the-cuff thoughts:
Remove any "battery optimiser", "task killer", "ram manager" or similar apps. Despite what they claim these things will reduce battery life and slow the phone down.
Look at your "power" settings to see what is actually using the energy. You can install a battery monitor such as GSam if you want more detailed information. If particular apps stand out as using power disproportionately, those are the ones to look into further.
If you have apps that regularly poll for updates (weather apps, pop3 email, news apps, whatever) then go into each app's settings and change how frequently they update. You can restrict background data usage globally, but consider whether that will stop some app notifying you of something you'd want to know.
WiFi uses less power than cellular data, so use that when available. And the screen is one of the biggest power drains, so don't set that brighter than you need. Because of the way AMOLED works, light backgrounds use a lot more power than dark on phones like the S5 which use that display technology, so you may save some power just by using dark wallpapers.