If you don’t want to index your site in any search engine, then you can use robots txt. Actually it can be done for new website. If a website is not ready for publish or onpage seo, user doesn’t want to index the site.

robots txt
Just simply write the below code in a text document and save as robots.txt

User-agent: *
Disallow: /

If you write the code and keep the file in your website, search engines can’t index your website. When you complete onpage SEO for your site, you can delete the code. Then you can index your site. After indexing your site, do offpage seo to rank your site in search engines. Without doing seo, you can’t rank your site. So it’s essential to do seo for every website to rank first. There are many tutorials in youtube. You can watch them and then you can do seo yourself for your site.

You can also disable any file or folder in your website.

Allow full access: Block all access:
User-agent: *
Disallow:
User-agent: *
Disallow: /
Block any folder: Block any file:
User-agent: *
Disallow: /folder/
User-agent: *
Disallow: /file.html

To know more about Robots txt, you can google.