To check if two trees are identical, you compare them node by node. Start at the roots. If both are null, the trees are the same (base case). If one is null and the other is not, they differ. If both exist, compare their values. If the values differ, the trees are not the same.
If the values match, recurse on the left children and the right children. Both left comparisons AND both right comparisons must return true for the trees to be identical. You check structure and values at the same time.