In principle, it is true that you cannot distinguish between two identical particles. However, if the overlap between the wavefunctions of the two particles is close to $0$, you can often treat the particles as distinguishable. There are mainly two cases in which this happens:
1. Particles separated by a "high enough" potential barrier
If two identical particles are separated by a "high enough" potential barrier (for example a "small box", but also a potential well corresponding to a lattice site), the overlap between the respective wavefunctions is very small (in the ideal case of an infinite potential barrier, the overlap is rigorously $0$). This means that we will always be able to tell with a high degree of accuracy which particle is where, i.e. we can treat them with an high degree of accuracy as distinguishable.
See also this answer by Arnold Neumaier.
2. "Far away" particles
If two identical particles are "far away" from each other, we can treat them as distinguishable.
Take for example two far away electrons: since they are indistinguishable fermions, their wavefunciton is
$$\Psi(\mathbf r_1, \mathbf r_2)=\frac 1 {\sqrt 2} [\psi_1(\mathbf r_1)\psi_2(\mathbf r_2)-\psi_1(\mathbf r_2)\psi_2(\mathbf r_1)]$$
Now consider the expected value of some observable $\mathcal O$:
$$\langle \mathcal O \rangle = \int \int d\mathbf{r}_1 d \mathbf{r}_2 [\Psi^*(\mathbf r_1, \mathbf r_2) \ \mathcal O \ \Psi(\mathbf r_1, \mathbf r_2)]=\\ \int \int d\mathbf{r}_1 d \mathbf{r}_2 [\psi_1^*(\mathbf r_1)\psi_2^*(\mathbf r_2) \ \mathcal O \ \psi_1(\mathbf r_1)\psi_2(\mathbf r_2)] - \int \int d\mathbf{r}_1 d \mathbf{r}_2 [\psi_1^*(\mathbf r_1)\psi_2^*(\mathbf r_2) \ \mathcal O \ \psi_1(\mathbf r_2)\psi_2(\mathbf r_1)]$$
Let's assume that $\psi_1$ and $\psi_2$ are sufficiently localized, i.e. that $\psi_1$ is appreciably different from $0$ only in a domain $D_1 \in \mathbb R^3$ and that $\psi_2$ is appreciably different from only $0$ in a domain $D_2 \in \mathbb R^3$, and that $D_1$ and $D_2$ don't overlap. We will then have for the second term
$$\int \int d\mathbf{r}_1 d \mathbf{r}_2 [\psi_1^*(\mathbf r_1)\psi_2^*(\mathbf r_2) \ \mathcal O \ \psi_1(\mathbf r_2)\psi_2(\mathbf r_1)] \\ \approx \int_{D_1} \int_{D_2} d\mathbf{r}_1 d \mathbf{r}_2 [\psi_1^*(\mathbf r_1)\psi_2^*(\mathbf r_2) \ \mathcal O \ \psi_1(\mathbf r_2)\psi_2(\mathbf r_1)] \approx 0$$
since $\psi_1 \approx 0$ in $D_2$ and $\psi_2 \approx 0$ in $D_1$. It follows that
$$\langle \mathcal O \rangle \approx \int \int d\mathbf{r}_1 d \mathbf{r}_2 [\psi_1^*(\mathbf r_1)\psi_2^*(\mathbf r_2) \ \mathcal O \ \psi_1(\mathbf r_1)\psi_2(\mathbf r_2)]$$
This means that the wavefunction
$$\tilde \Psi(\mathbf r_1, \mathbf r_2) = \psi_1(\mathbf r_1)\psi_2(\mathbf r_2)$$
which is a wavefunction for distinguishable particles, would have given us approximately the same result! Therefore, we can consider far away particles to be distinguishable.
See also this answer by tparker.