N5
~んです・のです
Explanatory, Emphasis, The fact is
ここのコーヒーが美味しいんです。
The coffee here is really good.
Explanation
「〜んです」 explains the reason or the situation so the other person understands you. For example, if someone sees you look unwell, you say 「頭が痛いんです」 (It's because I have a headache). In speech it is 「〜んです」; in writing or very formal speech it is 「〜のです」. Form: plain form of a verb or い-adjective + んです; noun or な-adjective + なんです.
Mixed up with
After a noun or a な-adjective use 「な」, not 「だ」: 「病気なんです」, 「暇なんです」; never 「学生だんです」 or 「嫌いだんです」.
「頭が痛いです」 just states that you have a headache; 「頭が痛いんです」 explains why and asks for understanding (for example, you want to leave early).
When someone asks you something, answering without 「〜んです」 can sound a little cold.