How do I answer questions like find all general solutions to :cos(x) = sin(x)?

I know I need to get 2 different equations like x = 2npi +/- ... for cos and x = npi + (-1)^n ... but how do I get it so that cos(x) = ... and sin(x) = ... so I can apply the formula to the equation