two-way analysis post-hoc test I am testing if there is a significant difference between microbes in different soil treatments and soil depth. I want to show the results in a table using post-hoc tests.
If the interaction is significant, then a post-hoc test between treatments is inappropriate right? So I should just do a post-hoc test if the interaction is not significant?

The general advice for post-hoc analysis after e.g. a two-way anova is: 1) If the interaction is not significant, but the at least one of the main effects is, to look at post-hoc comparisons for the significant main effects.  2) If the interaction is significant, to look at post-hoc comparisons for the interaction.
In general, if the the interaction is significant, it's more meaningful to look at the post-hoc comparisons for the interaction rather than for the main effects. For example, in your case, if you have good evidence that the effect of soil depth changes for different soil treatments, the comparisons of specific soil depths is somewhat besides the point.
The post-hoc analysis of the interaction could be to compare all combinations in the interaction.  Or you could "slice" the effect.  That is, look at the comparisons of the depths within each soil treatment.
But these guidelines aren't dictates.  You can do the analysis that makes the most sense for what you want to know.
