To pass from differential equation (continuous domain) to difference equation (discrete domain) you can approximate the derivative of a function with its difference quotient. That is:
dy/dt ≈ {y[i*T] - y[(i-1)*T]}/T i*T and (i+1)*T are the time instants the function is evaluated
if we consider, for instance, a simple RC lowpass filter having input "x" and output "y", using Laplace we have: transfer function = y/x = 1/(S*R*C+1)
this means a differential equation R*C*dy/dt + y = x
using, now, the difference quotient:
R*C*{y[i*T] - y[(i-1)*T]}/T + y(i*T) = x(i*T)
we can omit "T" as argument of the funcion, then:
R*C*[y(i) - y(i-1)]/T + y(i) = x(i)
rearranging:
(R*C/T+1)*y(i) - R*C/T*y(i-1) = x(i)
thus:
y(i) = 1/(R*C/T+1)*x(i) + (R*C/T)/(R*C/T+1)*y(i-1)
T is the so called timestep, the smaller the more accurate (and slower) the simulation.