How to understand the ambiguity of vector resolvation? When we solve problems where there is a pendulum suspended using a tight, inextensible string and the question asks about the tension developed in the string at the highest point of the bob's swing. The following is the conventional approach to solve the problem.

As you can see, even I resolved the tension and $mg$ into their respective components. The confusion I had was - here $T=mg\cos\theta$ and $mg=T\cos\theta$. How do I know which one to consider? Because they both make equal sense (to me at least) - their directions match perfectly.
 A: As pointed out by the comments, one of your equations is incorrect since it assumes the bob is not accelerating vertically at the highest point. Even though this is not really the main goal of your question,  let's first work with the correct equations just so we can get that out of the way.
Radially, we have a centripetal acceleration, so along the tension force we have
$$T-mg\cos\theta=ma_{\text c}=\frac{mv^2}{L}$$
where $L$ is the length of the string and $v$ is the speed of the bob. If the bob is at its maximum height, then $v=0$ and $T=mg\cos\theta$.
Vertically, we have some acceleration $a_y$ such that
$$T\cos\theta-mg=ma_y$$
At the maximum height $a_y\neq0$, so $mg=T\cos\theta$ doesn't hold here. It will be valid at some point between the maximum and minimum heights though, as the vertical acceleration has to change signs at some point during that time.
Now let's get to your conceptual issue.

How do I know which one to consider? Because they both make equal sense.

You are right! Both of these are valid equations. What you want to use depends on what you are looking at. Just because an equation is valid doesn't mean it is useful. For example, energy is conserved here, so we could also have the valid equation relating the maximum speed of the bob to its maximum height above its lowest point (assuming it's not making full loops around the pivot point)
$$\frac12mv_{\text{max}}^2=mgy_{\text{max}}$$
but if we don't care about the maximum speed or maximum height then this equation has little use for us.
So, if your care about the centripetal acceleration, maybe go with that equation. If you want to look at the vertical motion, maybe look at that one. Many equations can be valid for an aspect of a system; you need to learn which equations are useful for what you want to do. Note the contrapositive as well: just because an equation is not useful does not mean it is incorrect; this is something I see new physics students struggle with a lot.
A: Newton's Second Law is $\vec{F} = m \vec{a}$.  In terms of vector components, this becomes
$$ 
F_x = m a_x \qquad F_y = m a_y.
$$
Depending on how we set up our coordinates, we may have one or both of $a_x$ or $a_y$ non-vanishing.  But we can use our freedom to pick our coordinate axes however we want to simplify our life.  In particular, if we pick our coordinate axes so that $\vec{a}$ points along one of them, then the other component of $\vec{a}$ is zero.  This makes one of the terms vanish, simplifying the algebra.
In the present case, we can pick our axes so the $x$-axis points along the arc that the bob will describe, and the $y$-axis points along the string.  Since we are at the highest point of the swing, there is no centripetal acceleration; so the acceleration $\vec{a}$ will be in the $x$-direction only, with $a_y = 0$ and $a_x = a$.  The equations then become
$$
mg \sin \theta = m a \qquad T - mg \cos \theta = 0.
$$
This system of equations is particularly easy to solve for the unknowns $T$ and $a$:  we will have $T = mg \cos \theta$ and $a = g \sin \theta$.
But it's important to note that choosing different axes is not wrong, per se;  it just makes the algebra harder.  For example, suppose you chose horizontal and vertical axes instead.  In this case, you would have $a_x = a \cos \theta$ & $a_y = - a \sin \theta$, and Newton's Second Law would be (in these components)
$$
T \sin \theta = m a \cos \theta \qquad T \cos \theta - mg = -m a \sin \theta.
$$
This system of equations is harder to solve for $a$ and $T$, but you can show that the solution for $a$ and $T$ is exactly the same as we got above.  (Try it!)
A: The mg sin(θ) produces a torque causing an angular acceleration.  The T -  mg cos(θ) is not zero. It must provide a centripetal acceleration.The mg – T cos(θ) gives a downward component of acceleration.
