We know that 1 mol of any compound has 6.02x10^23 formula units (atoms, molecules, etc.)
6.02x10^23 is the Avogadro's number
We have here an atom of K, potassium. The, 1 mol of potassium is equal to 6.02x10^23 atoms of K.
Now we want to know how many moles are in 5.01x10^22 atoms of potassium
We proceed like this:
1 mol of K -------- 6.02x10^23 atoms of K
x -------- 5.01x10^23 atoms of K
x = 0.832 moles
Answer: 0.832 moles of K