Answer
The ionic compound formed would have the chemical formula $$K_2S$$
Work Step by Step
The electron configuration of $K$ is $$[Ar]4s^1$$
The electron configuration of $S$ is $$[Ne]3s^23p^4$$
Both of these atoms would tend to lose, gain or share electrons so that it could reach an octet, that is to have 8 valence electrons, or in other words, to achieve the configuration of a noble gas.
$S$ atom lacks 2 more electrons to reach an octet $(3s^23p^6)$, while $K$ atom, if loses its only valence electron in subshell $4s$, would achieve the configuration of noble gas $Ar$, with 8 valence electrons (an octet).
Therefore, $K$ atom is willing to lose 1 valence electron to the $S$ atom so that $K$ atom can reach an octet. However, the $S$ atom still needs 1 more electron to reach an octet. Therefore, another $K$ atom must join to give 1 more electron to the $S$ atom so that all can reach an octet.
Eventually, there is 2 $K$ atoms and 1 $S$ atom involved in the reaction. That means the ionic compound formed would have the chemical formula $$K_2S$$