2007 ford focus

I just bought my 2007 ford focus almost 2 months ago earlier in the week my battery light came on. That’s the first time it happened and then it didn’t do it again all week. Just a few minutes ago it came back on while driving my radio lights went off, then my dash lights, headlights, and I barely made it home before it completely died. I was wondering if this is a battery problem or an alternator issue. It’s odd for this to happen with no signs of a problem before this.