Find closest multiple of $40$ to $239$. We see that $5 \times 40 = 200$ is the nearest. Now subtract $200$ from $239$ to get reminder $39$. Add $5$ to quotient.
Since $39$ is less than $40$, stop the division. The reminder is $39$. The topmost line $005$ is the quotient. Remove all zeros at the start of the quotient to get the actual quotient $5$.