It doesn't behave as you'd expect if you are used to playing twin-stick shooters or Terraria, which follows your mouse more accurately.
But if it's farther away in any direction, you'll hit the square directly in front of the direction your character is facing. If your mouse is pointed at one of the eight squares adjacent to your character, that's where you'll hit. Then I discovered the 'Always Show Tool Hit Location' option in the settings menu, which shows a red outline around the tile you are targeting, and immediately understood what was happening. It felt like I wasn't always watering/chopping/hoeing the square I was aiming at, and I couldn't figure out why. I really like Stardew Valley, but the controls were incredibly confusing for me at first. Activate 'Always Show Tool Hit Location' immediately