The search for an exotic tetraquark state decaying into $\Upsilon(\mathrm{1S})\mu^+\mu^-$ performed at the CMS experiment is reported. An evidence for the $\mathrm{X}(3872)$ exotic state production in PbPb collisions is also presented, as well as the first observation of the $\mathrm{B}^0_\mathrm{s}\to\mathrm{X}(3872)\phi$ decay and the measurement of its branching fraction. The latter is found to be about two times smaller than $\mathcal{B}(\mathrm{B}^+\to\mathrm{X}(3872)\mathrm{K}^+)$, indicating the difference in the production dynamics of $\mathrm{X}(3872)$ in $\mathrm{B}^0_\mathrm{s}$ and $\mathrm{B}^+$ decays.