Thats a good question!
XAMPP should work right from the install without any need to adjust apache files.
Are you able to run the XAMPP control panel application?
Does the control panel show Apache as running?
If you answered yes to both questions click on the “admin” button and launch the admin web page.
On the left navigation panel check out status to see if everything you need is active, also the phpinfo() link to verify PHP is running.
If both the links work then double check your file names.
Make sure you don’t have the classic windows extension problem /feature where extensions are hidden.
Your file name might actually be index.php.txt but it only shows index.php in the explorer window.
This happens when you right click and create a new text file, then change the name.
If you are not set to view extensions this is easy to miss!
Also do regular web pages work, that you created? Like Index.html with just HTML no PHP