To lock the spindle on a CNC lathe, follow the manufacturer's instructions and use the dedicated spindle lock function or engage a mechanical locking mechanism, if available, to prevent the spindle from rotating while performing operations like tool changes or maintenance.