The big secret about matching texture that Dexter the bad texture guy
doesn't understand is: less is more.
Once the sheetrock (dry wall) is installed and you have successfully
ended up with a completely smooth, finished wall patch you could either
stop or you could continue and try to match the existing texture all
around the repair.
In many circumstances you could stop. If, for example, the patch is not
at eye level or in a conspicuous location you may be satisfied with the
patch as is. (Remember, all your attention has been at that patch ... most
people might not even see it).
I have a friend that would find it even if I put a refrigerator in
front of it. So if you feel the need to match the existing texture you
must decide what kind of texture is it. The two most common textures we
will look at are knockdown

and the splatter or orange peel.

This time we will work on the knockdown texture. Materials needed are:
Joint compound, 10 or 12 inch trowel (or joint knife), texture brush,
rags, pan and water source.
This is a texture brush.

Once the wall area is smooth, pat the brush into the mud a couple of
times to collect the mud.

Then in a random motion pat the brush onto the wall two or three times
as shown

Continue to add the mud to the wall until you have a 4 foot by 4 foot
area covered. Take the joint knife and wet it, then in a curving manner
lightly skim or "knockdown" the mud on the wall.

The knockdown texture can be added in a heavy fashion or light fashion
depending on the existing texture and your personal choice.
The splatter or orange peel can be accomplished by working with a
regular painter's roller and cover, joint compound, water, and pan. You
may need to lightly sand the area once it is dry. There are available at
most hardware stores spray cans of texture (about $12.00). These are good
for small areas but be sure to cover everything in the area!
Matching texture is a skill that takes patience and practice...
Remember: When matching texture the secret word is "understatement."