Solved.
I modified XAMPP's php.ini file to point to the xdebug.so that homebrew installed,
zend_extension="/opt/homebrew/Cellar/php/8.2.3/pecl/20220829/xdebug.so"
Then, I restarted the XAMPP server and ran this in terminal
/Applications/XAMPP/xamppfiles/bin/php -v
Before the expected PHP info, there were some errors. Several times in the warnings it stated "...(mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')..."
Oops.. I swore I chose x86_64..
So, I ran the following in terminal:
pecl uninstall xdebug
Then,
arch -x86_64 sudo pecl install xdebug
Following that I again ran /Applications/XAMPP/xamppfiles/bin/php -v and, voila!
PHP 8.2.0 (cli) (built: Dec 29 2022 08:42:31) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.0, Copyright (c) Zend Technologies
with Xdebug v3.2.0, Copyright (c) 2002-2022, by Derick Rethans
Xdebug installed :] Works in my IDE too.
Answer from jon.oneil on Stack OverflowVideos
Solved.
I modified XAMPP's php.ini file to point to the xdebug.so that homebrew installed,
zend_extension="/opt/homebrew/Cellar/php/8.2.3/pecl/20220829/xdebug.so"
Then, I restarted the XAMPP server and ran this in terminal
/Applications/XAMPP/xamppfiles/bin/php -v
Before the expected PHP info, there were some errors. Several times in the warnings it stated "...(mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')..."
Oops.. I swore I chose x86_64..
So, I ran the following in terminal:
pecl uninstall xdebug
Then,
arch -x86_64 sudo pecl install xdebug
Following that I again ran /Applications/XAMPP/xamppfiles/bin/php -v and, voila!
PHP 8.2.0 (cli) (built: Dec 29 2022 08:42:31) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.0, Copyright (c) Zend Technologies
with Xdebug v3.2.0, Copyright (c) 2002-2022, by Derick Rethans
Xdebug installed :] Works in my IDE too.
Homebrew has to be used in a consistent way: you can't use it to install an extension to a program installed by another way. If XAMPP is using its own set of paths and stuff, Homebrew can difficulty adapt to it: it's not made for that situation.
Why don't you change your "PHP executable" and "Configuration file" options to the homebrew ones?
Step 1: goto https://xdebug.org/wizard.php
step 2: copy and paste your phpinfo output to textarea which will be displayed on https://xdebug.org/wizard.php
step 3: click on analyze my phpinfo() output button, it will analyze your system and based on that it will give you suitable php_xdebug.dll file that you need to put at D:\xampp\php\ext folder
step 4: edit your php.ini file and add following line zend_extension = D:\xampp\php\ext\your-php_xdebug.dll
step 5: Restart Server
Reference Video Tutorial : https://www.youtube.com/watch?v=HbJOP0YcSjs
complete video Tutorial for PHP Debug Example : Demo
Recent XAMPP version(mine is v3.2.2) already had the file php_xdebug.dll in xampp\php\ext folder , so we don't need go to https://xdebug.org/wizard.php for downloading the file.
Just open the file xampp\php\php.ini, add the codes:
[xdebug]
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
Restart the XAMPP, then you could see the xdebug is working by type php --version in CMD:

For context I'm using XAMPP for Apache MySQL and PHP as opposed to installing all of them separately.
One possible issue is that Im using VSCode and they recommend installing the full version of PHP so that I can use their intellisense and debugging extensions.
My question is: is there a way for me to use a debugger for PHP with the way I have it set up currently?
I'm going to be doing some stuff with databases and being able to debug is important.