B12 is usually injected into a muscle. It can also be given through an IV.
If an IV is IV is inserted, there shouldn’t be a great deal of discomfort. However, if you are concerned about the insertion, speak with your doctor ahead of time to see what relaxation procedures should be taken.