Let $G$ be a locally profinite group (so a topological group such that every open neighbourhood of the identity in $G$ contains a compact open subgroup of $G$).
It is well know that $$G \text{ is compact } \iff G \text{ profinite }$$ and that $G$ is locally compact and totally disconnected.
This two information make me think that there is an obvious characterization $$G \text{ locally profinite } \iff G \text { locally compact and totally disconnected }$$ But in general I am not totally confidence with topological group, so probably there is a clear controexample that I don't know. Some hints?
If you are asking about whether the statement is true:
Yes, it is true. In one direction ($\Rightarrow$) it is obvious; and in the other direction ($\Leftarrow$) it follows, for example, from Theorem 7.7 of the book Abstract Harmonic Analysis by Hewitt and Ross.
Addition.
This last statement is known as the von Dantzig theorem. The proof can also be seen here, page 11.
Here are a few examples of locally compact totally disconnected groups:
Trivial example. Any (abstract) group G with the discrete topology is totally disconnected (and locally compact).
The additive group $\mathbb{Q}_p$ of the field of $p$-adic numbers has a compact open subgroup $\mathbb{Z}_p$ of $p$-adic integers.
The group $GL_n(\mathbb{Q}_p)$.
The group of almost automorphisms (spheromorphisms) of a regular tree. Details can be found in the paper cited above, pages 13-18.
Let $K/k$ be a field extension and $G = Aut(K/k)$ its automorphism group. If $K/k$ is of finite transcendence degree, then $G$ is a locally compact totally disconnected group.
HNN extension of compact groups. If $G$ is a compact totally disconnected group, $U$ and $V$ are open subgroups in $H$, and $\varphi: U\to V$ a continuous isomorphism, then the group $G=\langle H,t\mid tut^{-1}=\varphi(u),\ \forall u\in U\rangle$ is a locally compact totally disconnected group.
It is clear that new locally compact totally disconnected groups can be obtained from the consideration of direct products, semidirect products, etc. of already known locally compact totally disconnected groups.