We use long division of polynomials. First divide the first term in the divisor into the first term in the dividend. This is the first term in the quotient.

Multiply this term by the divisor and subtract from the dividend.

Divide the first term in the divisor into the first term in the remainder to get the next term in the quotient.

Multiply this term by the divisor and subtract from the remainder.

Divide the first term in the divisor into the first term in the remainder.

Multiply this term by the divisor and subtract from the remainder.

Put the remainder over the divisor and add the fraction to the quotient.

Check:

Multiply the quotient by the divisor and add the remainder.