The issue is because the project directory where the package is present, over there TestNG is not present. Make sure to the follow the hierarchy wrt src folder being inside project directory, and .java files and .class files will be automatically created as per your structure.
Hope this helps!
Check out the Selenium Testing Course and learn more about it.