The button most likely needs to be replaced. If you have a pre-manufactured computer (Dell, Acer, HP, etcetera) you can contact the company via their support website and order a new front panel. It should come with replacement instructions.
A good way to test whether it’s the button or the motherboard is to locate the power contacts on the motherboard (usually on the bottom, right portion of the board, the manual will tell you which contacts) and short them together while the power is plugged in and the power supply is turned on. Easiest way to do that is with a small flat head screwdriver.
You computer should have a manual on line that can be downloaded that will have the information, or if you tell us what model you have we can probably find the information.