Like @Asher and @s1212z said.
From the grammatical point of view, である can be used as both predicate of a sentence (when it is used at the end of it) and also used as attribute (when modifying/describing a noun). な can only be used in the second case. I would also add that it similarly differs from だ, that is だ can be used only in the final position, while である can be used as both. So it can perform functions of な and だ. It can also perform functions of の. である is often used in literary language, you use it for example when writing a thesis, scientific paper, in an encyclopedia, and so on. It is a form that didn’t change much with the passing time.
The final position of the sentence(predicative use):
He is a scientist.
Attributive use (noun):
An administrator who is in charge of a website.
Attributive use (Adjective):
Good A city that is quiet.
If we look at だ from a wider perspective, we can see that in the attributive form it can become な and の, which de facto simply mean “be that/be which/be who” and so on.
Copula type | だ | である
Attributive form | な、の | である | that be/ who be/ which be…
Predicative, nonpast form | だ | である | be
Hypothetical form | ならば | であれば | if it is
Conjectural form | だろう | であろう | probably be
past form | だった | であった | was
To sum up, you actually can use である instead of な・の in many cases but it will make it more literary. In some cases it might also sound unnatural, because such combination might be uncommon. である is more versatile and has easier to remember conjugation.
By the way, it may be interesting to learn about たる, which is similar to both な/である and is also an attributive form of the copula (とあり, which became たり), but its usage is limited nowadays.