A QUICK SHOT of silicon in the old keyhole, twice a year, can cut your chances (for some of you, the certainty) of standing in the rain some night, a bit head-leavened, maybe, stabbing futilely at a lock choked with dirt and corrosion.

A variation of this theme might have you rummaging your purse or pockets for a key you left in your dresser, too late at night to get a locksmith. It's happened to other folks. It should never happen to you.

Locks deserve attention, as much for reasons of convenience as for security. Ideally, they should be lubricated every few months, but can go a year without maintenance if necessary, according to an old-hand Silver Spring locksmith. Beyond that, corrosion and stiffness set in, especially in humid climates. Garage and gate locks, including padlocks, need more frequent maintenance.

Graphite powder, oil or petroleum jelly are good lubricants, he noted, but a less messy choice is the silicon or petroleum-distillate spray found in hardware stores. These leave a clean, frictionless film that balks corrosion and helps moving parts work smoothly. Spray the bolt and hand latch, if there is one, and use a hollow coffee stirrer or a thin plastic straw (one usually comes with each can of lubricant) to fire directly into the keyhole. The arthritic locks on the inside doors of old houses can usually be freed this way, too.

The old trick of heating a key with a match is still the best way to melt a frozen car lock. Don't pour hot water into the keyhole: It has a way of temporarily freeing the lock so you can get into the car, then trapping you inside when the water freezes again. Insert the key gently to avoid breaking the metal plug covering the keyhole. TheReader's Digest Fix-It Manual (Pleasantville, N.T . . . The Reader's Digest Assn., Inc., 1977) recommends using an alcohol-base deicer or spray lubricant to make sure it doesn't happen again.

Locks that are too far gone in grime to respond to lubrication can be disassembled and soaked in turpentine, suggests Home Security, by Charles Dunne and Richard V. Nunn (Birmingham, Ala: Oxmoor House, Inc., 1975). Excess paint can be removed with paint thinner. Steep the lock in the solvent a few minutes and wipe the paint off with a stiff brush. Use alcohol, or soap and hot water, to get rid of the paint thinner. Be sure to use the solvents in a ventilated area.

You can avoid the cost (several area locksmiths quoted an average of $20) of having a locksmith make a house call to replace lost keys by keeping spares in a secure but accessible place, and by making a record of the code number engraved on each key. This "blank number" allows the locksmith to make a replacement key without taking castings of the keyhole.The skeleton keys used for the simple locks on inside doors of old houses can be replaced at the locksmith's for 30 to 40 cents.

When an old swivel window lock gets hard to open, it might be worthwhile to replace it rather than restore it. Key locks, available for $4 - $5 at large department stores and hardware shops, offer more security than swivel locks, and are less obtrusive, since they're installed on the side of the upper sash where they can be concealed by drapery.They have the added advantage of being deployable in two positions: when the window is closed entirely, or when it's open up to three inches for ventilation.

Other books you might find useful in your search for security are:

How To Burglar-Proof Your Home by Robert L. Robinson (Chicago: Nelson-Hall, Inc. 1977). Discusses problems of security and helps you choose locks for all uses.

All About Locks and Locksmithing by Max Alth (New York: Hawthorn Books, Inc. 1972). Explains the workings of various locks, with long segments on how the patient person can pick them.