We theoretically analyze a hybrid system consisting of a levitated neutral atom and a nanoparticle coupled to a cavity. The mechanical oscillator and the atom are effectively coupled to each other through the cavity photons as a bus. By adjusting the driving lasers, we can conveniently switch the phonon-atom coupling between JC and anti-JC forms, which can be used to manipulate the motional states of the mechanical oscillator. As an application, we prepare a superposition state of the mechanical oscillator via the effective phonon-atom interaction and investigate the effects of dissipation on the state generation.