One idea
A CTE is a named temporary result inside one query. Use it to make each step of your logic visible.
Your final SELECT should read like the answer. The CTEs above it should show how you got there.
Why CTEs matter
In product analytics, one question often needs many steps. For example: filter valid events, join users, calculate revenue, rank cities.
You can do this with nested subqueries. But they become hard to check. CTEs make the same work easier to read, debug, and explain in your project README.