As @DanCouper said, I have no insight into your specific cause here because it sounds like something very odd has happened.
If you are the only one working on this repo, then just getting it working again by reinitialising the repo could be a sensible idea. You’ll lose your git history, but if that doesn’t matter for you in this instance than it’ll lead to the least heartache.
You wouldn’t be able to do that on a professional repo, most likely, so you can decide what is more important to you today: fix the immediate problem quickly and get on with learning what you were trying to learn; or take a detour and learn one of the more esoteric features of git and know that if you can document it well enough that you can learn from it you’ll basically be a mini-git wizard and know at least one thing that will impress seasoned devs who still find this stuff tricky to resolve.
(Aside: It’s probably worth creating some branches to test resolving this conflict on. Literally branch off master and attempt to merge your current changes into that branch - when you figure out what works on your throwaway branches, it’ll work on master too. The trouble with trying everything you can think of on master is that you could just end up getting even more tangled.)
VSCode has a pretty good UI for dealing with merge conflicts - it presents the conflicted file and has little links above the conflicted sections allowing you to pick the current state, the incoming changes, or both. You can also edit them as you see fit, just remember to remove all the markers etc and save before recommitting.
If the VSCode one doesn’t suit you, GitKraken also has a really nice UI for merge conflicts - it’s a little more fully featured and gives you a little more control over what lines get included or not from each version, and the order they appear in.
Good luck, git merges can be very challenging, so don’t be too disheartened if you find the solution does to you!