comparing and contrasting why is sodium hydrogen carbonate an effective antacid but sodium hydroxide is not?

Both are effective as far as neutralization of acids but NaHCO3 is mild enough that humans can tolerate it; NaOH will cause serious issues with the body especially in stronger doses.