You write the electron structure like this.

1s2 2s2 2p6 3s2 3p6 3d10 4s1 is the neutral Cu atom.
Remove the two outside electrons to make the Cu^+2 ion. That leaves us with
3d9 as the outside and since that is an odd number, one electron must be unpaired. And you will note that many Cu(II) compounds are colored.

So for CoCl2·6H20 the electron configuration is [Ar]4s2 3d7 because Co is 2+ so would the unpaired electrons be 3? is that right?

Yes, it has 3 unpaired electrons BUT 4s2 are missing for the Co^+2 ion in the compound CoCl2.6H2O. You wrote the electron configuration for the neutral atom.

Do you know how to almost without thinking write the 3d electrons in the 3d transition series. It's the DrBob rule.

To determine the electron configuration of a neutral copper (Cu) atom, we start by filling up the electron orbitals according to the Aufbau principle, Pauli exclusion principle, and Hund's rule.

The Aufbau principle states that electrons occupy the lowest energy level orbitals first before moving to higher energy levels.

The Pauli exclusion principle states that each orbital can hold a maximum of two electrons with opposite spins.

Hund's rule states that electrons occupy orbitals of the same energy level singly, with parallel spins, before pairing up.

For the neutral Cu atom, the electron configuration is as follows:
1s2 2s2 2p6 3s2 3p6 3d10 4s1

In order to form the Cu^+2 ion, two electrons need to be removed from the outermost energy level. So, we remove the two electrons from the 4s orbital:

1s2 2s2 2p6 3s2 3p6 3d10 4s0

Now, let's look at the outermost energy level, which is the 3d orbital. Since the 3d orbital can hold a total of 10 electrons, and we have already removed 2 electrons, we will be left with 8 electrons in the 3d orbital.

Therefore, the electron configuration of the Cu^+2 ion becomes:
1s2 2s2 2p6 3s2 3p6 3d8

In this case, the 3d orbital has 8 electrons, and since 8 is an even number, all the electrons are paired. Consequently, the Cu^+2 ion does not have any unpaired electrons in the 3d orbital.

On the other hand, for CoCl2·6H2O, cobalt (Co) is in the 2+ oxidation state (Co^2+). The neutral Co atom has the electron configuration:
1s2 2s2 2p6 3s2 3p6 4s2 3d7

To form the Co^2+ ion, two electrons are removed from the 4s orbital:

1s2 2s2 2p6 3s2 3p6 4s0 3d7

In this case, the outermost energy level is the 3d orbital, and we are left with 7 electrons. Since 7 is an odd number, one of the electrons in the 3d orbital will remain unpaired.

Therefore, the electron configuration of the Co^2+ ion becomes:
1s2 2s2 2p6 3s2 3p6 4s0 3d7

As you mentioned, Co(II) compounds often exhibit color because of the presence of an unpaired electron in the 3d orbital, which can absorb and emit specific wavelengths of light.

Yes, you are correct. The electron configuration for a neutral cobalt atom is [Ar] 4s2 3d7. However, when Co forms a 2+ ion (Co2+), it loses two electrons, leaving it with the electron configuration [Ar] 3d7. Since the 3d subshell has 5 orbitals, there will be 7 electrons in the 3d subshell for Co2+.

Out of these 7 electrons, one electron will be unpaired. This is because whenever there is an odd number of electrons in a subshell, at least one electron must be unpaired. Therefore, in the case of Co2+, you would have one unpaired electron in the 3d subshell.

This unpaired electron can lead to the coordination of other ligands in Co2+ compounds, which can cause the compound to have color.