Use synthetic division to divide the first polynomial by the second.
x³ - 2x + 1
x + 4
Write the first polynomial as
x³ + 0x² - 2x + 1
Change the sign of +4 to -4
-4|1  0  -2  1
  |            
Bring down the 1
-4|1  0  -2  1
  |            
   1
Multiply the 1 by the -4 and write it above above and to the right
of the 1 that you just brought down
-4|1  0  -2  1    
  |  -4        
   1
Add the 0 and the -4, getting -4, and write it under the -4
-4|1  0  -2  1
  |  -4        
   1 -4
Multiply the -4 at the bottom by the -4 at the far left, getting 16.
Write that above and to the right of the -4 at the bottom:
-4|1  0  -2  1
  |  -4  16    
   1 -4
Add the -2 and the 16, getting 14, and write it under the 16
-4|1  0  -2  1
  |  -4  16    
   1 -4  14
Multiply the 14 at the bottom by the -4 at the far left, getting -56.
Write that above and to the right of the 14 at the bottom:
-4|1  0  -2   1
  |  -4  16 -56
   1 -4  14 
Add the 1 and the -56, getting -55 and write that under the -56
-4|1  0  -2   1
  |  -4  16 -56
   1 -4  14 -55
Now we must interpret the numbers at the bottom.  The last number
-55 is the remainder, and the numbers to the left of it are the
coefficients of the quotient polynomial which has degree which is
one less than the original polynomial:
So the answer is
                   -55
   x² - 4x + 14 + ------
                   x+4
Or if you prefer:
                    55
   x² - 4x + 14 - ------
                   x+4
The synthetic division is just a shortcut for this long division:
                x² -  4x + 14
    x + 4)x³ + 0x² -  2x +  1
          x³ + 4x²
              -4x² -  2x
              -4x² - 16x
                     14x +  1
                     14x + 56
                          -55
 which yields the same answer.
Edwin