In both $[Co(NH_3 )_6 ]^{3+} $ and $[CoF_6 ]^{3-} Co$ is present as $Co^{3+}$ Thus, the electronic configuration of $Co$ is
$_{27}Co = [Ar] 3d^7 ,4s^2 $
$_{27} Co^{3+} = [Ar] 3d^6 , 4s^0$
In case of $[Co(NH_3 )_6 ]^{3+} NH_ 3 $ is a strong field ligand, so pairing of electrons in $3d$-orbital takes place.
$_{27} Co^{3+} = [Ar] 3d^6 , 4s^0$
In $[CoF_6 ]^{3−}, F$ is a weak field ligand, thus does not cause pairing. Hence,
$_{27} Co^{3+} = [Ar] 3d^6 , 4s^0$