Minecraft does not by default use any externally-installed Java installation on Mac. Instead, when you first run it, it downloads its own copy of the Java runtime. The
java executable itself is at:
where ~ is the user account's home directory. The Library directory is hidden by default by Finder to help users avoid making changes which could break their programs, but you can get to it by selecting "Go > Go to Folder…" from the Finder's menu bar and entering "~/Library" in the box that appears.
If you have a hard time finding the runtime, just launch Minecraft (the game itself, not just the launcher), then in the macOS dock, find the "java" icon in the Dock (the list of icons which usually runs horizontally at the bottom of the screen - try using Command-Tab to switch to the Finder and then move your pointer all the way to the bottom of the screen if you don't see it), and Control-Click (or right-click) it and select "Options > Show in Finder" from the contextual menu that appears.
Incidentally, if what you're trying to do is get Minecraft to use an M1-optimized build of Java for better performance, the instructions in this tutorial worked great for me.