The origin of high-temperature superconductivity has been widely debated since its discovery. Here, we propose a model to reveal the mechanism based on the interaction between carrier and local potential. In this model, the potential that is analogous to the lattice point is composed of localized charges and its vibration mediates the coupling of mobile carriers. A Hamiltonian that describes the vibration, coupling, and various interactions among the ordered potentials and carriers is established. By analyzing the Hamiltonian, we find that the vibration of local potential and the interactions, which are determined by the carrier density, control the transition temperature. We show that the transition temperature is high if the local potential is composed of electrons and the mobile carrier is hole because of the strong coupling between them. By replacing the local potential with lattice point, our model is equivalent to the BCS theory. Therefore, our model may provide a general theoretical description on the superconductivity.