We theoretically investigate first and second sound of a two-dimensional (2D) atomic Bose gas in harmonic traps by solving Landau's two-fluid hydrodynamic equations. For an isotropic trap, we find that first and second sound modes become degenerate at certain temperatures and exhibit typical avoided crossings in mode frequencies. At these temperatures, second sound has significant density fluctuation due to its hybridization with first sound and has a divergent mode frequency towards the Berezinskii-Kosterlitz-Thouless (BKT) transition. For a highly anisotropic trap, we derive the simplified one-dimensional hydrodynamic equations and discuss the sound-wave propagation along the weakly confined direction. Due to the universal jump of the superfluid density inherent to the BKT transition, we show that the first sound velocity exhibits a kink across the transition. Our predictions can be readily examined in current experimental setups for 2D dilute Bose gases. Low-energy excitations of a quantum liquid in its superfluid state -in which inter-particle collisions are sufficiently frequent to ensure local thermodynamic equilibrium -can be well described by Landau's two-fluid hydrodynamic theory [1,2]. It is now widely known that there are two types of excitations, namely first and second sound, which describe respectively the coupled in-phase (density) and out-of-phase (temperature) oscillations of the superfluid and normal fluid components [3]. Historically, Landau's two-fluid hydrodynamic theory was invented to understand the quantum liquid of superfluid helium [2]. The study of first and second sound in such a system has greatly enriched our knowledge of the fascinating but challenging many-body physics. For any new kind quantum fluids, it is therefore natural to anticipate that first and second sound may also provide a powerful tool to characterize their underlying physics.