There is no single algorithm for this; it is done intuitively by building $1 \times N$ blocks and inserting them. However, a key concept for big cubes is creating the "Opposite Center."
The standard 3×3×3 Rubik’s Cube has 43 quintillion states. For n>3, the state space grows factorially. The most efficient human method is reduction: xnxnxnxn cube algorithms pdf nxnxn rubik cube link
On 4×4:
r2 U2 r2 U2 u2 r2 u2
Swaps opposite dedges in U layer.
For larger even n, apply to the two middle slices. There is no single algorithm for this; it
Odd cubes (5×5, 7×7) can have pseudoparities solved by re-pairing a few edges – no special algorithm needed. Swaps opposite dedges in U layer