This survey examines the geometrically nonlinear bending of a doubly clamped nanobeam that is subjected to combined actions of actuator voltage, prestress, and intermolecular force, with the pull-in instability as the primary objective. A nonlocal Euler-Bernoulli beam model, which takes the small scale effect into account, is developed making use of the principle of virtual displacement on the basis of Eringen's nonlocal theory in conjunction with von Kármán assumption. Due to complexity of the resulting equations, a shooting technique is established through taking the applied voltage as an unknown and the central deflection as a control parameter. This treatment has the capability of tackling the nonlinearities from both the large deformation and electrostatic force as well as the intermolecular force and enables the size dependent deflection response to an applied voltage of the nanobeam to be obtained conveniently. Validation is conducted in numerical examples through direct comparisons with existing solutions to confirm the proposed method. Parametric studies are undertaken addressing the impacts of the nonlocal effect, intermolecular force, residual stress, and geometry of the beam on the pull-in behaviors.