The first step is to fix a coordinate system. You can chose any coordinate system you want, but if you pick one that is convenient, calculations become much simpler. Since here you have the angles given to the horizontal, it is natural to pick one coordinate (let's say $x$) along the horizontal and for convention let it point to the right. Let's put the other coordinate ($y$) be perpendicular up and the origin where the forces meet.
Adding forces is very easy, just like vectors you just need to add the components of the forces:
$$\vec{F}=\vec{F}_1+\vec{F}_2=\begin{pmatrix}F_{1x}\\F_{1y}\\F_{1z}\end{pmatrix}+\begin{pmatrix}F_{2x}\\F_{2y}\\F_{2z}\end{pmatrix}$$
This works in all coordinate systems. Specifically in your case you have all forces in a 2D plane, so you can ignore the third ($z$) coordinates.
To find the components of the forces you can either:
(1) always take the angle to the positive $x$ direction ($\phi_{x+}$) and then you don't need to worry about any minus signs as the coordinates will be $F_x=F\cos\phi_{x+}$ and $F_y=F\sin\phi_{x+}$. In your case that would be for instance $F_{1x}=F_1\cos (180^\circ-45^\circ)$ and $F_{1y}=F_1\sin (180^\circ-45^\circ)$
or (2) take the projection to any axis and add a minus sign if that projection points in the negative direction of the axes. In your case the projection of $\vec{F}_1$ to the x-axis would be $F_1\cos(45^\circ)$. From the figure you see that this points in the negative direction so the vector component will get an additional minus sign: $F_{1x}=-F_1\cos(45^\circ)$.
Once you have done all this, you should have $\vec{F}_1$ and $\vec{F}_2$ written in coordinates, you can add these coordinates to obtain the coordinates of the resultant force, $(F_x, F_y)$.
In the same way that you expressed the components of $\vec{F}_1$ and $\vec{F}_2$ in terms of the angle, you now have to reverse this procedure in order to get the angle from the components. Using the first method outlined above you know that the relationship between the angle to the positive x-direction and the coordinates is:
$$F_x=F\cos\theta\\
F_y=F\sin\theta$$
or alternatively:
$$\tan\theta=\frac{F_y}{F_x}$$
where you have to be careful with special cases where $\cos\theta=0$
Since you know the coordinates of the resultant force, you can find the angle from these equations easily.
First of all, an expression like
$$dE_{x} = d\vec{E}\,\cos\theta$$
can never be correct. If you have a vector on the right, you will also have a vector on the left. The correct expression would be
$$dE_{x} = d\vec{E} \cdot \hat{u}_x = \frac{dq}{4\pi\epsilon_{0}r^{2}} \underbrace{(\hat{u} \cdot\hat{u}_x)}_{\cos\theta} = \frac{dq}{4\pi\epsilon_{0}r^{2}} \cos\theta$$
which is indeed a scaler ("just a number", as you call it).
What is happening here is that we want to know the electric field vector
$$ \vec{E} = \begin{pmatrix} E_x \\ E_y \\ E_z \end{pmatrix}. $$
However, we know from symmetry, that two of these entries must be zero.
$$ \vec{E} = \begin{pmatrix} E_x \\ 0 \\ 0 \end{pmatrix}. $$
Now, because we already know which direction the field is pointing (along the $x$-axis), we only need to calculate the magnitude of $E_x$ to get our result. So we extract the scalar $E_x$ from the vector like this:
$$ E_x = \hat{u}_x \cdot \vec{E} = \begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix}\cdot\begin{pmatrix} E_x \\ E_y \\ E_z \end{pmatrix}$$
Now we want to know the contribution of a line element to the total field, which you have already given
$$d\vec{E} = \frac{dq}{4\pi\epsilon_{0}r^{2}}\hat{u}$$
But we only need the $x$-component, which is the projection of $d\vec{E}$ onto the $x$-axis, which is already given above
$$dE_{x} = d\vec{E} \cdot \hat{u}_x = \frac{dq}{4\pi\epsilon_{0}r^{2}} \cos\theta$$
from the geometry of the problem.
Then calculation for $E_x$ continues as in your post. However, in the end we want the electric field vector, so we need to substitute the magnitude of $E_x$ back into a vector that has only an $x$-component.
$$\vec{E} = \begin{pmatrix} E_x \\ 0 \\ 0 \end{pmatrix} = E_x \cdot \begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix} = E_x \cdot \hat{u}_x$$
Best Answer
$\hat \theta$ is a unit vector which is at right angles to the unit vector $\hat r$.
If this is so then $\hat \theta \cdot \hat r =0$
So you need to find a vector $\hat \theta = a \hat x + b \hat j$ such that the conditions $a^2+b^2 =1$ and $\hat \theta \cdot \hat r =0$ are satisfied.
You will find that there are two unit vectors $\hat \theta$ which satisfy those conditions and by convention the vector which is pointing in the anti clockwise is the one which is used.
I have annotated your diagram to try and show you what is going on.
You have a unit vector $\hat r$ in green with components $(+\cos \theta, +\sin \theta)$ shown in violet.
The unit vector $\hat r$ can be rotated with the locus of the head of the vector shown as a dashed black line which is an arc of a circle of radius one.
As you want $\hat \theta$ shown in red to be at right angles to $\hat r$ it has components $(-\sin \theta, +\cos \theta)$ shown in blue.
Simple geometry can be used to show that all angles $\theta$ are the same because $\hat \theta$ is perpendicular to $\hat r$.