How to create a file that cannot be removed without root permission in macOS?

Solution 1:

So I found what I should do from the link provided from anki .

All I need to do is chflags uchg <file>

The details of this command are in this link: http://hints.macworld.com/article.php?story=20031017061722471