An ordered set $S$ is said to have the least upper bound property if, for every non-empty subset $E$ which is bounded above in $S$, the supremum of $E$ exists in $S$.
So let's look at your question and the example in the description of your question.
The set you have taken is $\mathbb{Q}$ which is indeed ordered. The subset of $\mathbb{Q}$ you have taken is $A=\{x \in \mathbb{Q} : x^2<2\}$, which is indeed non-empty. You are also right in inferring that $A$ is bounded above.
So we are left with questioning whether $A$ has a supremum in $\mathbb{Q}$. Note that this is usually not enough to prove a statement, but since we just want a counter-example here, this will suffice.
The supremum of $A$ if considered as a subset of $\mathbb{R}$ is $\sqrt{2}$. But $\sqrt{2}$ is not a rational number. This should be enough.
If you want to prove that $A$ does not have a supremum in $\mathbb{Q}$, you can do so using the method of contradiction. Assume there exists a rational number $r$ which is the supremum of $A$.
Case 1: $r$ is less than $\sqrt{2}$
Since between any two distinct real numbers there is a rational number, there exists a rational number greater than $r$ which belongs to $A$. This contradicts our assumption that $r$ is the supremum of $A$.
Case 2: $r$ is greater than $\sqrt{2}$
Since between any two distinct real numbers there is a rational number, there exists a rational number lesser than $r$ which is an upper bound of $A$. This contradicts our assumption that $r$ is the supremum of $A$.