TestNG.xml file is a configuration file that helps in organizing our tests. It allows testers to create and handle multiple test classes, define test suites and tests.
It provides parallel execution of test methods. It allows the dependency of one test method on another test method. It helps in prioritizing our test methods. It allows grouping of test methods into test groups.
Refer the video on how to use testNg.xml