The meta tag can easily be added with a custom module. Or you can modify one of the twig files that adds another meta tag and add your to it (you need to do this thought the template edit feature for the changes to stick). Or you can use this module
https://market.x-cart.com/addons/custom-http-headers-by-cfl-systems.html to add x-robots-tag header tag - more info
https://developers.google.com/search/docs/advanced/robots/robots_meta_tag
robots.txt file is optional and you need to add any entries in there manually. Keep in mind though most bots ignore this file especially the malware bots.