Assuming pressing the power button doesn't turn the screen off, and long-pressing it doesn't bring up the power menu (which is how to diagnose a non-functioning power switch), the switch has to be replaced. While it's not a difficult repair for an experienced tech, I wouldn't advice trying to do it yourself. Check eBay for repair services (search for
s4 power switch) to see what it would cost (include shipping and insurance) and compare that to the price a local repair shop or your carrier's repair location will charge. (If the phone happens to still be under warranty, it's covered.)
In any case, back up
everything. If it's under warranty, the phone is usually replaced while you wait. If you have it repaired, the first thing a good shop will do is a factory reset (we used to do that in front of the customer, as we were taking the phone in for repair, and the repair order the customer signed included a statement that the customer saw us reset all the data on the phone - that's so the shop can't later be sued for stealing the data, pictures, etc.) So whichever way you go, you'll probably lose all your data. Back up the apps (so you don't have to download them again) the apps' data, pictures, videos, make sure all the contacts are Google contacts (which are backed up on Google's cloud) or use an app like
MyPhoneExplorer to back them up (and you can change the type of contact by copying and pasting in that app - pasted contacts can have their type changed, then you can delete the original), back up any texts you want to save - when I say everything, I mean everything (that you don't want to lose).