Express Integer as Sum of Two Squares

Is there a general method to expressing integers as the sum of two squares or do you just need to be good with numbers? For example, consider the following problem:

Express 605 as the sum of two squares

Now I believe that a solution to this problem exists because $605 = 5 \cdot 11^2$ and $11 \equiv 3 \pmod 4$ which appears an even number of times and $11$ is the only number in the prime factorization that is congruent to $3 \pmod 4$.

So looking at this problem, what are the first steps that you should take to try and solve this problem? Is there a quick way to go about this?


I'm not an expert, but from memory something which it turns out is called the Brahmagupta–Fibonacci identity or occasionally Diophantus identity (used constructively in the proof of the result of Fermat) might be useful: see Wikipedia.

$$\left(a^2 + b^2\right)\left(c^2 + d^2\right) = \left(ac-bd\right)^2 + \left(ad+bc\right)^2 = \left(ac+bd\right)^2 + \left(ad-bc\right)^2$$

This allows you to strip off factors one at a time.

Where you have squares in the factorization, as in the $5\cdot 11^2$ case, note that the square can be factored out as $(p^2+q^2)m^2 = (pm)^2 + (qm)^2$