What are radicals in chemistry?
but how do ions have unpaired electrons when an ion has all its electrons paired either by loosing or gaining electrons to attain the nearest noble gas configuration?


(Quote from your question, emphasis mine)

Your fallacy is the word I emphasised. Surely it is often taught like that—especially in introductory chemistry—that when ions are generated the noble gas configuration (vulgo: octet or dublet in the case of He configuration) is reached. That is not the whole truth, though.

Especially when you form a polycharged anion such as oxide $\ce{O^2-}$, you can (and should!) consider the electrons being added (or removed) stepwise. Thus, going from an oxygen atom you would initially generate an oxide radical anion $\ce{O^.-}$ before arriving at the classical oxide anion $\ce{O^2-}$. If you look at it energetically, the first electron addition is sometimes (but not always!) exothermic but the second one is always endothermic, so it makes energetic sense to separate like this.

These monoatomic radical ions are not commonly encountered as they typically have very short half-lifes. They often rapidly react to either give the full noble gas ion or the original, neutral atom. However, the vast majority of known ions are molecular or polyatomic ions such as phosphate. Within these, one very common species of radical anion forms rather stable compounds: the superoxide anion $\ce{O2^.-}$.

Structure-wise, it is similar to the peroxide anion $\ce{O2^2-}$ which can be written as $\ce{^-O-O-}$ except with one electron removed. However, it is usually generated  starting from dioxygen ($\ce{O2}$) with one electron added, which turns dioxygen’s double bond ($\ce{O=O}$ in Lewis formality) into a single bond. when the heavy alkaline metals (potassium, rubidium or caesium) are burnt in air, the corresponding superoxide is the product:

$$\ce{K + O2 -&gt; KO2}\tag{1}$$

If lithium or sodium are reacted identically, the product is the oxide or the peroxide, respectivesly:

$$\begin{align}
\ce{4Li + O2 &amp;-&gt; 2Li2O}\tag{2}\\
\ce{2Na + O2 &amp;-&gt; Na2O2}\tag{3}\end{align}$$