To understand the formula:
1) draw a Cartesian coordinates with a unit circle (centred at origin with a radius of 1).
2) draw a vector pointing towards 2-oclock (so we have $\theta = 30$, this is arbitrary but I prefer this 30 degree angle as I tend to confuse the sin and cos on a 45 degree angle) with a length of 1, so this vector ($\vec{V}$) ends on the unit circle.
3) The key point to remember is that we are converting the unit vectors of the Cartesian system ($\hat{i}$ and $\hat{j}$) to those of the polar system ($\hat{r}$ and $\hat{\theta}$). Unit vector by definition is length 1.
4) To get to the radial unit vector $\hat{r}$: move $1\times cos(\theta)$ units along the x direction ($cos(\theta) \hat{i}$), then move $1\times sin(\theta)$ units along the y direction ($sin(\theta) \hat{j}$). That is the 1st equation: $\hat{r} = cos(\theta) \hat{i} + sin(\theta) \hat{j}$. Note that this how vector additions work. Draw it out on your paper and you will figure it out immediately.
5) Now to get the tangential unit vector ($\hat{\theta}$): that is, by definition, right-angle to $\hat{r}$, with a length of 1. So you will know that all you need to do is switch the positions of $cos(\theta)$ and $sin(\theta)$ in your 1st equation, and add a minus sign to one of them (so the dot product of these 2 resultant vectors is 0, equivalent to perpendicular). As we define anti-clock wise as the positive direction, the minus sign goes to the $\hat{i}$ direction. So here it is the 2nd equation: $\hat{\theta} = -sin(\theta) \hat{i} + cos(\theta) \hat{j}$.
6) If you dislike the step (5) way. Draw that $\hat{\theta}$ out on your unit circle: starting from origin, pointing towards 11-oclock (right angle to $\hat{r}$) and ending on the unit circle (length=1). To get to that end point by moving only along x- and y- directions, first move $-1\times sin(\theta)$ units on x-, then $1\times cos(\theta)$ units on y-. You get the same formula.
To reverse the conversion: from polar to Cartesian, you could simply do some pure algebra on the 2 equations we just derived, or use geometry to "move to" the target point you wish to derive.