Both are excellent, well-researched ingredients — they just solve slightly different problems.
Niacinamide
Helps balance oil, refine the look of pores and support the skin barrier. Gentle enough for most skin types, morning or night.
Vitamin C
An antioxidant that brightens dull skin and helps fade the look of dark spots. Best in the morning under sunscreen.
Can you use both?
Yes. Apply vitamin C in the morning and niacinamide at night, or layer them with a minute between. Patch-test anything new first.