<aside> ℹ️ There are many types and classifications of fonts. Each of them has its own history and origin. We are interested in those types of typefaces that work in user interface design, and there are several: Serif, Sans, Slab, and Mono.
</aside>

All the others are too decorative and apply only with great care and a complete understanding of why.

It's all about readability. This is the essential thing in user interface design. Readable text and quickly scannable headings indicate the suitable typeface. Decorative style and being unusual is also good, as long as readability is still achieved.

Experiment and try decorative fonts, such as for headings (with caution), to create an unusual and eye-catching design. But it's better to use familiar typefaces when it comes to button labels, call-to-action links, and other meaningful text.
Although most likely, the user of your interface will not have even a second to parse the letters in the decorative font and will simply ignore this caption, moving on to a more readable text or go away.
Each type of font can be suitable for different tasks. Therefore, more often than not, the preference for a font type depends on the goals of your project and the desired result. But there are typical situations where one typeface fits and works better.
Use sans fonts wherever necessary. These fonts constantly scan and read well, especially in short headings and captions. It is a universal solution for UI design in any situation.

Sans typeface is suitable for all cases, but is best read in short headings and captions.