So when I hike, usually I get a small pebble or two, or sand in my boots. How can I prevent this? I already wear pretty tight boots, and stopping every so often to take off a boot and get a rock out is annoying.
You can get some trail gaiters. (This REI link gives a good overview of different types of gaiters, their components, and materials they can be made from.) They're basically little sleeve-like things that have a strap to go around the bottom of your hiking boot, and they come up to mid-calf usually. Because they overlap with both your boot and your pants, they should be pretty good at keeping rocks out of your shoes.
They typically look something like this:
There are, however, variations in types and usage of gaiters. They can be mid-calf height or knee-high, insulated or uninsulated, waterproof or not. (Short gaiters that only cover the instep and the ankle are sometimes called spats - they are also sometimes just called "low gaiters".)
For me it's all about gait. We do river hiking where it's easy to flip up sand into a shoe if not careful. The trick is to lift your feet and step without either toe or heal dragging, as well as to set them down in a controlled manner.
If you're using mid- to high- length boots, there are a number of models of pants that have a small hook or strap at the very end of the pant leg used to fix the pant leg to the boot lace at the ankle. These are usually accompanied by a vertical strap so that the pant leg can be fixed snugly around the ankle.
I personally used these while serving in the (Swedish) army. The M/90 uniform pants have these features and I never got snow/stone/pebbles etc into my boots. Lundhags "Boot-Loc"-system is an example of this.
Cut a pair of socks in half! Cut across about two inches above where the toes would be. Then slide these over the top of your boots. Works for me! :)
If you are hiking in warm weather and want to keep things more light and airy, trail running gaiters (such as these) are light and breathable and will protect from sand and pebbles specifically.