I'm convinced that there is a configuration file in XAMPP that needs to be altered. When I type in "localhost" I'm taking to a project that I've been working on for the past 3 weeks, instead of the htdocs folder, which is where I initially installed it(i think). Any help will be greatly appreciated.
Since your question does not clearly depict your problem I am assuming that you are not able to run the correct path of your Magento folder to run setup. So I will tell you the correct method to do so.
1.start your lampp by the command sudo /opt/lampp/lampp start
2.In the case of Linux follow the path opt/lampp/htdocs. If you are using Windows OS then search for the xampp folder. You will find a htdocs folder in it.
3.In the htdocs folder create a new folder let us say it “MyProject” give it the required read/write permission.
4.extract your magento2 zip folder here. Let us name this extracted folder as Magento2.Open this folder. Check the path currently it would be: opt/lampp/htdoc/MyProject/Magento2
5.copy the path MyProject/Magento2
6.on the browser write the URL as : localhost/ MyProject/Magento2.
If you follow all the above steps you will be redirected to the Magento setup page.