Let $P$ be a preorder, and $Idl(P)$ be the set of all ideals over $P$ ordered by subset inclusion. It is well-known $Idl(P)$ is a dcpo.
An ideal $I$ is principal if there is a $p \in P$ such that $I = \{ x \in P \mid x \le p \}$.
Question: How to show that: if $I$ is a compact in $Idl(P)$, then $I$ is a principal ideal?
My thoughts: The hypothesis ($I$ is a compact) says something about directed sets of ideals. The only directed set of ideals I can think of is the set of ideals included in $I$...
Your thoughts are in the right direction. It is all about cleverly choosing the ideals included in $I$.
Claim 1. The set $\mathcal{A}$ of principal ideals that are included in $I$ is directed.
Proof. Let $J, J' \in \mathcal{A}$ and let $x, x' \in P$ be such that $J = \{y \in P : y \leq x\}$ and $J' = \{y \in P : y \leq x'\}$. As both $J$ and $J'$ are subideals of $I$ we have that $x,x' \in I$ so there is $z \in I$ such that $x \leq z$ and $x' \leq z$. Now consider the principal ideal $J^* = \{y \in P : y \leq z\}$, then clearly $J, J' \subseteq J^*$, and we conclude that $\mathcal{A}$ is directed.
Claim 2. We have $\bigcup \mathcal{A} = I$, in other words $I$ is the join $\bigvee \mathcal{A}$ in $Idl(P)$.
Proof. Clearly $\bigcup \mathcal{A} \subseteq I$ as every element of $\mathcal{A}$ is a subset of $I$. Conversely, let $x \in I$ and define $J = \{y \in P : y \leq x\}$. Then $J \in \mathcal{A}$, so $x \in J \subseteq \bigcup \mathcal{A}$. As $x$ was arbitrary we have $I \subseteq \bigcup \mathcal{A}$ and the claim follows.
Using the claims and the fact that $I$ is compact in $Idl(P)$ we have that $I \subseteq J$ for some $J \in \mathcal{A}$. As also $J \subseteq I$ we have $I = J$ and so $I$ is principal.