There are many different technologies that can be used to do what you want: a relay, a logic gate chip, a pre-packaged flipflop logic chip, or two transistors plus some resistors. What parts do you have, and what parts are you comfortable using?
Also, are AA batteries a requirement, or is a...