Which one to take?
Most of what you find for sale is actually D3. That’s what people usually call vitamin D.
No reason to consider D2 (the other common form) unless you have specific problems with D3.
And by the way, get informed before taking vitamins. Vitamin D is not so good for you alone.
Vitamin D is typically either D2 or D3. D3 is the more common one and is somewhat better absorbed. In supplements it’s typically derived from sheeps wool.
D2 is fungus derived. It’s only ever really used in high doses as a prescription product (which is mostly historical happenstance - the equivalent high dose d3 exists but isn’t a prescription only product, so it isn’t often covered by insurance in the US) or by strict vegans, who don’t want anything derived from animals (even if it’s from wool).