Heavy-light decomposition (HLD) also flattens trees for range queries. HLD handles arbitrary path queries, not root paths or subtrees. Euler tour is simpler and faster for subtree queries.
HLD is more effective but has higher constant factors. If the problem only asks for subtree or root-path queries, use Euler tour. For general path queries, learn HLD. Both techniques flatten the tree into an array, but they use different orderings to make different query types efficient.