  We investigate the behavior of relativistic electrons encountering a
potential step through analogies with optical phenomena. By accounting for the
conservation of Dirac current, we elucidate that the Goos-H\"anchen shift can
be understood as a combination of two components: one arising from the current
entering the transmission region and the other originating from the
interference between the incident and reflected beams. This result has been
proven to be consistent with findings obtained utilizing the stationary phase
method. Moreover, we explore the transverse Imbert-Fedorov shift, by applying
both current conservation and total angular momentum conservation, revealing
intriguing parallel to the spin Hall effect. Beyond enriching our comprehension
of fundamental quantum phenomena, our findings have potential applications for
designing and characterizing devices using Dirac and topological materials.
