I accidentally changed my spawn location, and now I'm lost. How do I find my way back?
Solution 1:
There are a few ways you may be able to get back home.
The simplest is to craft a compass which will point you to the world spawn. It's unclear from your post whether you used commands to change the spawn point to a village, or used a bed, but assuming you just used a bed then the compass would point you towards 0,0 which may be enough to help you navigate home once you reach the center of the map.
If you're willing to use commands then I'd recommend temporarily setting your game mode to creative and fly around until you're able to locate your base. In creative mode you'll be faster and able to fly over obstacles. You'll be able to find and identify landmarks more easily from a great altitude.
Solution 2:
there are couple of ways you can make your way to your base
1 - craft a compass
crafting a compass which will point to the world spawn
2 - when you go to settings you should see your seed copy the seed and make a another world with the same seed and if you didnt change the spawn using commands in your orginal world then write your cords and go to the real game and follow that cords