Let $K$ be a compact subset of a $C^{*}$-algebra $A$ and let $\delta>0$ be given. I'm trying to prove that there is a $b\in A$ such that $\|ba-a\|<\delta$ for all $a\in K$.
This seems like an easy exercise, but I don't know how to proceed. I tried to work with an approximate unit $(u_{i})$ of $A$, which always exists. One then has $\|u_{i}a-a\|\to0$ for all $a\in K$. But then I don't see how I can use the compactness of $K$ here.
Any help would be appreciated!
Your idea of using an approximate unit is a good one.
Let $\delta > 0$ be given. Note that $$K \subseteq \bigcup_{a \in K} B(a,\delta/3)$$ so by compactness, there exist $a_1, \dots, a_n \in K$ such that $K \subseteq \bigcup_{j=1}^n B(a_j,\delta/3)$.
Then, choose a large index $i$ such that $\|u_i a_j-a_j\| < \delta/3$ when $j=1, \dots, n$. Then $b:= u_i$ works. Indeed, let $a \in K$. Choose $j$ such that $\|a-a_j\| < \delta/3$. Then $$\|ba-a\| \le \|u_ia -u_ia_j\| + \|u_ia_j-a_j\| + \|a_j-a\|$$ $$\le 2\|a-a_j\| + \|u_i a_j-a_j\| < \delta.$$