Doctors can only give precriptions for vitamins in cases of proven vitamin deficiency. So, while vitamin B (of which there are several types, all with different properties - B1 thiamine, B2 riboflavin, B3 niacin, B5 panothenic acid, B6 pyrodoxine, B7 biotin, B9 folic acid, and B12 cobalamins or cyanocobalamin) may help, you should discover which one the doctor meant, and not expect a prescription.
By the way, the number following B should be subscript in each case, but it's not possible to format replies like that - of if it can be done, I haven't discovered how.
Deficiency in vitamin B6 is known to result in depression, among other symptoms, including dermatitis, hypertension (raised blood pressure), water retention, and elevated levels of homocysteine.