Forget the advertisements. There is no rationale for otherwise healthy people to take a vitamin B12 supplement to improve their cognitive function or for any other reason.
Not only should you stop before buying vitamin supplements–watch John Oliver for a funny explanation here, but there is also concern that supplements you buy at the drug store or vitamin superstore are not what you think they are. Because the FDA does not regulate these supplements, they may not be safe or as described on their label, either as pure or as strong.
This all said, you should talk to your doctor if you are feeling weak or tired, or have sensory problems, including tingling in your feet or hands or you are experiencing memory problems. Some people cannot absorb B12 from food or are not receiving enough in their food because of dietary choices (e.g, vegetarians) and may benefit from an oral B12 prescription or an injection after laboratory testing demonstrates a B12 deficiency. It could prevent further decline or even reverse these conditions. And, if you are a vegan you should talk to your doctor about taking a B12 supplement because the way to get B12 is through eating clams, salmon, trout, liver, beef, cereal and eggs and drinking milk, most of which is lacking in a vegan’s diet.
Keep in mind though that you should not decide on your own to take a B12 supplement no matter what symptoms you have. Vitamin B12 supplements should be used cautiously if you have any of a number of health conditions or if you are allergic to cobalt. So, do not go out and buy a vitamin B12 supplement without first talking to your doctor.