As a rule of thumb, If you heading/title is a font and not a logo, use sans-serif for titles/headings. Serif fonts end up drawing focus on the font instead of the content.

Serifs often have a more professional look (newspapers/books) and may legible at smaller font sizes.

Often, the large title at the top of a page/document/website will be sans-serif, and the text will be serif. Buttons/Components in websites/apps more often use sans-serif.