The ATLAS experiment at the Large Hadron collider measures various heavy flavor production processes.
This paper focuses on the measurement of $W$ boson production in association with a charmed hadron in $pp$ collisions at $13 ~\mathrm{TeV}$ as well as on the production of $\Upsilon(nS)$ mesons in $Pb + Pb$ and $pp$ collisions at $5.02~\mathrm{TeV}$.
Both of these analyses are important for the understanding of the heavy flavor properties under various conditions.