The generation of a nerve impulse begins with a change in the membrane potential of the neuron. This usually occurs due to the influx of sodium ions (Na+) into the neuron, leading to depolarization of the membrane. If the depolarization reaches a certain threshold, an action potential is triggered. This rapid change in electrical charge travels along the axon.