Official ranks are almost always in the same predictable places: directly outside arrivals at airports, at the main exits of railway stations, outside large hotels, and at marked stands in city centers. The key habit is to join the organized queue rather than accept an offer from someone approaching you inside a terminal, because touts and unlicensed drivers work the arrivals hall in many countries while legitimate drivers wait at the rank.
Identifying legitimate taxis varies by city, since each licensing authority picks its own look, whether it is a specific color scheme, a roof light, or municipal markings. The reliable universal signals are a visible license number, a displayed driver ID card inside the cab, a meter, and official airport signage directing you to the rank. Some airports also use a dispatcher who hands you a slip with the taxi number, which is a great anti-scam feature, so keep that slip.
Do two minutes of homework before arrival: search what licensed taxis look like in that city and whether the airport uses fixed fares. Your airline's destination guide or the airport's own website usually covers it.