To typeset pseudocode in LaTeX, use the algorithm float with algpseudocode (algorithmicx) or the algorithm2e package. Copy-paste templates for both inside.