How to find the values of x and y in equations like ax+by=c? for example this equation: 505x-673y=1 . x=4 and y = 3. but how can I find them with mathematics. What would be the approach here?
This was a comment, but I think deserves to be an answer.

As your question is asking for a method, here it is.


1) First, divide by the common factor $d=GCD(a,b,c)$.
2) Then apply "extended Euclidean algorithm" which will give you  coefficients $x',y'$ called "Bezout coefficients". 
3) The final coefficients are : $x'=dx, y'=dy$.


See the details of point 2) here.
This is a simply diophantine equation. To solve this, you have basically to express $673$ in terms of $505$ and $1$ using euclid algorithm. The result, as you have shown is $x=4$ and $y=3$ because:
$$505\cdot4-673\cdot3=1$$