Chinese has no single "yes"
English has one word for "yes" that covers every affirmation. Chinese has several, and which one you use depends on the question. The two biggest are 对 (right, correct) and 是 (to be, it is so). Other affirmative answers: 有 (affirms 有-questions, "yes I have"), 会 (affirms 会-questions, "yes I can"), 好 (agrees with a suggestion, "okay"). Echoing the question's verb is the Mandarin affirmation pattern.
是 answers 是 questions
Questions using 是 as the main verb or copula get 是 in the affirmative: 他是老师吗? 是 (Is he a teacher? Yes, he is). 这是你的吗? 是的 (Is this yours? Yes). 是的 (shì de) is a politer, slightly more formal variant of plain 是 for affirmation. 对 would sound off here because the question is asking about identity, not correctness.
A: 这是你的书吗? B: 是的。
A: Zhè shì nǐ de shū ma? B: Shì de.
A: Is this your book? B: Yes.
对 answers fact and statement questions
对 works when the question asks whether something is right: 三加三等于六,对吗? 对 (three plus three equals six, right? Right). 你今天有空,对吧? 对 (you are free today, right? Right). 对 also answers questions where the speaker confirms a claim: 你昨天去了公园? 对,我去了 (you went to the park yesterday? Yes, I did). If the question is a statement plus tag (对吗/对吧), reply 对.
A: 你住在北京,对吗? B: 对,住在朝阳区。
A: Nǐ zhù zài Běijīng, duì ma? B: Duì, zhù zài Cháoyáng qū.
A: You live in Beijing, right? B: Right, I live in Chaoyang district.
Echo-the-verb answers
For non-是 questions, the most natural answer echoes the verb. 你吃饭了吗? 吃了 (Did you eat? Ate). 你会中文吗? 会 (Do you know Chinese? Can). 你有兄弟姐妹吗? 有 (Do you have siblings? Have). Applying 是 or 对 in these cases is sometimes acceptable but sounds indirect. The echo answer is the Chinese default.
Negation: 不是 vs 不对
不是 negates 是 questions: 不是,我不是老师 (No, I am not a teacher). 不对 says "that is wrong": 不对,不是这样的 (Wrong, it is not like this). 不对 is stronger than 不是 because it asserts the other side made a factual error; 不是 only declines the specific copula claim. Choose based on whether you are correcting (不对) or clarifying (不是).