How to differentiate hydrous and anhydrous compound?
There is no general answer to this question.
Heating is probably the best approach. It is not the only one. For some compounds, heating the hydrated variety produces an emission of water vapor, and nothing else, like $\ce{CuSO4·5H2O}$ or $\ce{Na2CO3·10H2O}$. For others compounds, it may produce a total decomposition like $\ce{AlCl3·6H2O}$, which is transformed into $\ce{Al(OH)3 + HCl}$ at high temperature. Considering the corresponding anhydrous compounds, $\ce{CuSO4}$ is decomposed into $\ce{CuO + SO2 + O2}$ at $650$°C. $\ce{Na2CO3}$ resists decomposition up to $1200$°C. $\ce{AlCl3}$ sublimes at $177$°C. You see that there is no general rule.
You may also check the behaviour of your hydrated compound with substances that react violently with water like thionyl chloride $\ce{SOCl2}$. if there is a reaction, it is probably a hydrate. But it may also be an anhydrous compound that react with $\ce{SOCl2}$, a metal for example, or an organic acid.
If you want a better answer, please give us the names of the particular compounds you are interested in.