Most people know their commute costs something — gas, transit fare, parking — but very few have actually added up the real number, because it's spread across so many small line items that no single one looks alarming on its own. Add them up and the total is usually a lot higher than the gut-feel estimate.
What actually goes into the number
Start with the obvious: fuel or transit fare, parking, tolls. Then add the costs that don't feel like commuting costs but are entirely driven by distance: extra vehicle depreciation and maintenance from the added mileage, higher insurance if you're rated by commute distance, and the opportunity cost of the time itself if you'd otherwise be doing paid work, a side hustle, or something that reduces another expense, like cooking instead of buying lunch out because you're rushed.
For drivers specifically, it helps to think in cost-per-mile rather than per-tank-of-gas, since fuel is often less than half of what driving actually costs once depreciation and maintenance are factored in. For transit users the math is simpler but the time cost is often larger — a longer but cheaper commute can still be the more expensive option once you value your own time honestly.