How do you read an EXPLAIN ANALYZE plan in PostgreSQL?

You're looking at the EXPLAIN ANALYZE output for a slow query. Where would you start? Explain the order in which plan nodes execute and what cost, rows, actual time, and loops mean. How do Seq Scan, Index Scan, Index Only Scan, and Bitmap Heap Scan differ? Where would you look for the bottleneck?

ExplainEXPLAIN and optimizationMiddleBackendData Engineer