What you're looking for is called panning. Here's an article about panning: https://web.archive.org/web/20190325183501/https://www.dawsons.co.uk/blog/what-is-panning
Essentially, panning is the direction a digital sound seems to be coming from. It is literally exactly what you described in your question! Be aware that panning will only manipulate whether a sound seems to come from the right, the left, or from ahead. (Unfortunately, it is impossible to make a sound seem to come from above or below, or to make a sound seem to some from ahead instead of behind or visa-verca. This isn't a limitation of technology, but rather of the human hearing system: we can only discern locations based on sound along the axis our two ears lie on.)
Panning is usually measured in software as a unitless number from -1 to 1, with -1 begin a sound coming directly from the left, 0 being a sound coming directly ahead, and 1 being a sound coming directly from the right. Then, fractional panning values indicate sounds coming from different angles. For example, a sound located halfway between the left and directly ahead of a listener would have a panning value of -0.5.
Look up how panning is handled in the library you are using for sound in your game development. I predict that the object representing an individual sound will have a panning attribute you can set to change which direction the sound seems to be coming from when you play it. Be sure to read the documentation carefully so you know what numbers the panning attribute takes because although the -1 to 1 system for describing panning in software is common, it isn't universal.
Since it's not possible to pan a sound in front of or behind a player, your game has an unfortunate limitation: If the sound is north or south of the player, it will be indistinguishable which direction the player should go. One way to work around this is to allow the player to rotate the camera.
For example, suppose there's a sound coming from due north of the player. It's panning value is 0: directly north or south of the player, but indistinguishable which. Then, the player rotates the camera 90˚ clockwise, so that north is now on the left side of the screen. Now, the sound will be clearly coming from the left and have a panning value of -1.
Rotating the camera in this way is analogous to turning or tilting your head to get a better idea of where a sound is coming from. If a sound is coming from ahead or behind you, it can be difficult to tell exactly where is is for the aforementioned reasons. But if you turn your head, what was previously in front of and behind you is now to your left and right, and it will be easier to tell where it is.