There are formulae for these

So if your complex number is a+bi,

r=√(aČ+bČ)

Now for θ you need to make sure you get your answer in the right quadrant.

So draw your complex number on an argand diagram and see where it is.

If it's in the 1st quadrant, eg. 2+5i, then θ = arctan(b/a)

2nd quadrant, eg. -2+5i, then θ = pi - arctan(b/a)

3rd quadrant, eg. -2-5i, then θ = arctan(b/a) - pi

4th quadrant, eg. 2-5i, then θ = - arctan(b/a)

I hope this helps.