It is likely a hardware issue. As a general rule of thumb if the computer is a 2015 or later it may be worth fixing. Of course you will need to take ti to your local Apple Authorized Service Provider. To locate an AASP please click AASP Locator to begin your search.
If the computer is a 2014 or earlier it is likely obsolete meaning Apple no longer makes parts. In that case it would be wise to shop for a replacement Mac. There are many options available to you if this is the route you want to take. This would include new Macs (iMac, Mac Mini, MacBook Air, MacBook Pro etc.) , looking at Apple refurbished Macs, or even high quality used machines available from reputable resources. ID any of those options interest you and you need further help please let us know.