You might appreciate the series of Khan Academy lectures (+ practice problems, etc).
Each lesson is given via a short 12 minute video, which you can replay if needed: the link I'm including below should take you to "Algebra" lessons; but you might also want to look at "Developmental math I and II".
This is a great way to learn via video demonstrations, practice, repetition, etc., and if you stumble, say, with negative exponents, e.g., you can go directly to a lesson addressing the issue at hand. I believe there is diagnostic testing available (this is all free, no fees for watching videos, doing practice sets, tests, etc.), and such testing can really be helpful in learning where you need to direct your energies to move to the next level.
Edit: I've also come across this site, devoted to tutoring/demonstrating how to factor polynomials: it's developmental in approach, in that it starts slowly, with very common patterns used when factoring, and progresses in difficulty, building on what you've already learned, so best to approach the tutorial in the order given.
It has to do with the particular form of your subtraction. Since you are subtracting a number with all $9$ from another with also all $9$, the result will be a number that has a number of $9$ on the left and then all the zeroes together on the right.
The fact that $2009$ is not a multiple of $2$ nor $5$ tells you that all the powers of $10$ are on $p-q$, and so you can cancel them on both sides: on the left you'll get all the $9$, and on the right a multiple of $2009$.
Best Answer
Start with any quadratic with integer coefficients: $$Ax^2+Bx+C$$
Now let's follow what your teacher did.
Step 1. Write $x^2+Bx+AC$.
Step 2. Factor $x^2+Bx+AC=(x-q)(x-p)$.
Step 3. Write $(x-\frac{q}{A})(x-\frac{p}{A})$ and reduce the fractions $\frac{q}{A}=\frac{r}{s}$ and $\frac{p}{A}=\frac{t}{k}$.
Step 4. The desired factorizations is $(sx-r)(kx-t)$.
To prove this works, note from step 2 that $B=-(q+p)$ and $AC = pq$. This is sufficient information to obtain the roots of $Ax^2+Bx+C$ by the quadratic formula: $$ x=\frac{-B\pm \sqrt{B^2-4AC}}{2A}= \frac{q+p\pm \sqrt{(p+q)^2-4pq}}{2A}= \frac{q+p\pm \sqrt{(q-p)^2}}{2A}.$$ So the roots are $\frac{q}{A}$ and $\frac{p}{A}$. This agrees with what we found above, since $\frac{q}{A}=\frac{r}{s}$ and $\frac{p}{A}=\frac{t}{k}$.