How do antihistamines work?
First you need to undertand what a histamine is. A histamine is a little substance that is released into your bloodstream when your body detects something (pollen, dust. dander, certain foods, insect stings...) that it really doesn't like and doesn't want invading your system. These histamines work like crazy to get the irritant out by making your nose or eyes run, breaking into hives, itching, swelling up - whatever it can do to muster the troops and try to bust that allergen out of there.
This can be a useful defence system, but it can, more often than not, be annoying for you as you try to work through your day or get to sleep at night. That's why you might want to take an antihistamine.
Antihistamines block histamines. There are lots of different brands of antihistamines, but they all basically work by blocking or stopping some, but often not all, histamines from being released in your body. So, for example, in the early spring, when the pollen starts to fly, they try to control your body's natural defence system against those allergens, by telling it to shut off the tap that makes your nose run. Or, if you get a wasp sting, they can usually help tell your body to stop itching.
Why do some antihistamines make me sleepy?
It has to do with the size of the molecule.
If the anti-histamine is a very very tiny molecule, it can slip through the blood-brain barrier, and therefore make your brain feel sleepy. Hence the warning, "Do not drive or operate heavy machinery."
For an anti-histamine to make you feel tired, it must pass through the blood-brain barrier. If the anti-histamines are bigger molecules, they are less likely to be able to slip through the blood-brain barrier, thus decreasing the risk of sedation, so you'll be able to go on with your day.