Macbook air randomly shuts off and won't turn on or charge
Over the last few months, my 11 inch Early 2014 Macbook Air has been shutting off randomly whether it's plugged in or not. When I try to turn it back on, it usually takes three tries. Many times, it also refuses to charge. Last night when I had left my macbook to charge and the orange light was on. This morning the Macbook wasn't charging at all, and the battery was at 29% and then promptly shut off after 10 seconds of usage. I've been struggling to get my macbook to turn on all day, so I finally reset the SMC. The Macbook finally turned on, but again shut off promptly after I logged in to the computer. It still refuses to charge.
The Macbook Air does this whether I run High Sierra or Mojave. Any thoughts?
MacBook Air 11", macOS 10.14