How to use a color palette [on hold]

I find a lot of different color palette on internet that are interesting but I do not know how to correctly use it.

Most of them have five colors which I presumed are :

  1. Primary
  2. Accent
  3. Secondary
  4. Foreground
  5. Background

This was found on internet (I don't remember the website)

  • First of all, is it the good way to split the colors ?

  • How can I decide that a color will be the Accent or Secondary ?

  • Where should I use those Primary, Accent and Secondary ? The menu should be in primary ?

Here is an example of color palette : The palette