We study the influence of step defect on surface states in three-dimensional topological insulators subject to a perpendicular magnetic field. By calculating the energy spectrum of the surface states, we find that Landau levels (LLs) can form on flat regions of the surface and are distant from the step defect, and several subbands emerge at side surface of the step defect. The subband which connects to the two zeroth LLs is spin-polarized and chiral. In particular, when the electron transports along the side surface, the electron spin direction can be manipulated arbitrarily by gate voltage. And no reflection occurs even if the electron spin direction is changed. This provides a fascinating avenue to control the electron spin easily and coherently. In addition, regarding the subbands with high LL index, there exist spin-momentum locking helical states and the quantum spin Hall effect can appear.