reducing $CLIQUE$ from decision to search problem
Keep removing vertices until the graph no longer contains a clique of size $k$, and let $v$ be the last vertex that you removed. It follows that there is some $k$-clique which contains $k$. Remove all vertices from the graph other than neighbors of $v$ (so $v$ itself is also removed), and recursively find a $(k-1)$-clique in the new graph. Add $v$ to this clique to create the desired $k$-clique.

The algorithm can also be formulated iteratively:


Let $C = \emptyset$ (this will be the clique).
Let $\ell = k$ (the current size of the clique).
Go over all vertices $v$ in the graph:


Check if after removing $v$ from the graph, the new graph still contains an $\ell$-clique.
If so, continue to the next vertex.
Otherwise, add $v$ to $C$, decrease $\ell$, and remove from the graph all vertices other than the neighbors of $v$.

Return $C$.