It depends why it isn't working, but we'd need more information to guess at that. Did anything happen before this started: software update, dropped the phone, etc? Has the phone ever got wet (even if months ago)?
Without more information all I can suggest is taking it in for repair. You could try pulling the battery out for a couple of minutes and see whether it's better after that - unlikely, but it won't do any harm. Or you could do a factory reset; also unlikely to help (because it's more likely to be a hardware problem than a bad app or corrupted settings), but it's about the only thing else you can do.
But as I say, I think it most likely that this is a hardware problem of some sort, so repair is probably the answer (unless it's moisture damage in which case you probably need a new phone).