We'd be able to advise better if we had more information:
Is this one button or all not working? Which model of phone (some have mechanical buttons, some capacitative)? Has anything happened recently (software updates)? Has the phone ever got wet?
In the absence of other information all I can suggest is that you back up any important data then try a factory reset. If that doesn't fix it, it's likely that it needs repair.