The definition of a subobject classifier is given by:
Definition 8.16. Let $\cal E$ be a category with all finite limits. A subobject classifier in $\cal E$ consists of an object $Ω$ together with an arrow $t :{\sf 1}→Ω$ that is a “universal subobject,” in the following sense:
Given any object $E$ and any subobject $U \rightarrowtail E$, there is a unique arrow $u : E →Ω$ making the following diagram a pullback(Sorry for inclusing a picture but it seems that we cannot draw commutative diagram in MathJax...):
$\require{AMScd}$ \begin{CD} U @>>> 1\\ @V mono V V @VV t V\\ E @>>u> \Omega \end{CD}
This is exercise 8.12 (a)
(a) Explicitly determine the subobject classifiers for the topoi $\sf Sets^2$ and $\sf Sets^ω$, where as always $\sf 2$ is the poset $0 < 1$ and $ω$ is the poset of natural numbers $0 < 1 < 2 < ···$.
In the solution he gives, it is claimed that:
For any poset $\sf P$, the subobject classifier $Ω$ in $\sf Sets^P$ is the functor: $Ω(p)=\{F ⊆P | (x ∈ F ⇒ p ≤ x)∧(x ∈ F ∧x ≤ y ⇒ y ∈ F)\}$, that is, $Ω(p)$ is the set of all upper sets above $p$. The action of $Ω$ on $p ≤ q$ is by “restriction”: $F\mapsto F|_q = \{x ∈ F | q ≤ x\}$. The point $t :1→ Ω$ is given by selecting the maximal upper set above $p$, $t_p(∗)=\{x | p ≤ x\}$.
I wish to understand this answer. And my difficulty is to determine the desired unique natural transformation $E\to \Omega$. Could someone please help? Moreover, it seems to me that it is not easy to determine the arrow $E\to \Omega$, are there some general way or useful idea to find it?

Writing out what's going on explicitly in $\mathrm{Set}^{\boldsymbol 2}$, which is the category of arrows of $\mathrm{Set}$, should help.
In that case, $E$ is just an arrow $f : X → Y$, and $U$ is a restriction of $f$ to some $X' ⊆ X$ and $Y' ⊆ Y$ such that $f(X') ⊆ Y'$.
To find the map $E → Ω$, note that, first, there are 3 kinds of elements of $X$: those that are in $X'$, those that are not in $X'$, but are "in $Y'$", by which I'll mean that $f(x) ∈ Y'$ (note that elements in $X'$ are automatically "in" $Y'$), and those that are neither. Similarly, there's two kinds of elements of $Y$: those in $Y'$, and those that aren't.
$Ω$ is the arrow $\{∅, \{1\}, \{0, 1\}\} → \{∅, \{1\}\}$ given by intersecting with $\{1\}$, and now it's clear which elements we should send where. For $X$, map elements of $X'$ to $\{0, 1\}$ (they're both in $X'$ and "in" $Y'$), map the rest of $f^{-1}(Y')$ to $\{1\}$, the complement of it to $∅$, and do the similar for $Y$.
For arbitrary posets the idea should be the same: given a functor $X : P → \mathrm{Set}$ (ie. a $P$-shaped diagram) and a subfunctor $X' ⊆ X$ (just a diagram of coherently chosen subsets), the elements of an $X_p$ are either in $X'_p$ (and automatically (their images are) in all of the subsets that follow), some "future" sets $X'_q$, where $q$'s obviously form an upset, or never reached in $X'$.
Explicitly, for $p ∈ P$ and $x ∈ X_p$, $u_p(x)$ is the upper set of $p$ consisting of $q$'s that $x$ eventually reaches in the subdiagram, ie. such that $ξ_{pq}(x) ∈ X'_q$, where $ξ_{pq} = X(p < q)$.