I have a very basic doubt but I am new to inference statistics so please pardon me. My question is when we do hypothesis testing for two samples, we estimate the confidence interval and then if the confidence interval includes 0, we fail to reject the null hypothesis (if I am not wrong?). Now as far as our critical regions are concerned, we fail to reject the null hypothesis if the t-score lies in the non-critical region. So then aren't these two ideas contrasting? What if our confidence interval consists 0 but then our t-score is in the non-critical region. Do we fail to reject the null or do we accept the null hypothesis?
Usually, test and confidence interval will match so that $p\leq \alpha$ corresponds to $1-\alpha$ confidence intervals (CIs) contains null value of the parameter of interest. This is for example usually the case for a single comparison for continuous data.
"Mismatches" between the two things can occur e.g. when you use variance estimates that are only valid under the null hypothesis for the test statistic, but to ensure CI coverage under alternatives you do use a different estimate for constructing the confidence interval (that e.g. occurs for some popular ways of comparing two binomial proportions). In most cases this kind of discrepancy is small. Similarly, things become more complicated when multiple comparison adjustments are in play. In these cases, the rejection of the null hypothesis should be based on the statistical test rather than the CI.