The only thing at work in a deodorant is fragrance.
It may be natural fragrances from oils, or it may be chemical perfumes, but when you use it, all you’re doing is masking the smell.
An antiperspirant, however, contains aluminum or zirconium to block pores so sweat can’t escape from the sweat glands as easily, decreasing both wetness and the reproduction of those smelly bacteria.
So if you smell, use a deodorant. If you want to prevent being smelly, use an antiperspirant. But make sure you have a bath before you layer on the goop, otherwise you’ll still smell pretty bad.