You just have to remember in most cases. There are a few tricks though.
Every word that is a person like sister, brother, uncle (zus, broer, oom) has a 'de': 'De zus', 'De broer', 'De oom'. Except for 'meisje' which uses 'het'.
Every word ending in 'je' in the form where it means small, little etc, 'het' should be used: 'Het varkentje' (The small pig), 'Het paardje' (The small horse), 'Het schildpadje' (The small turtle).
That also explains why 'meisje' is a 'het'-word.
There may be more rules, but in general you have to learn them for each word.