The domain includes all the possible values of x. The range includes all the possible values of y.
So, for example, if we take the function f(x) = 5/x, we need to exclude zero from the domain as we are not allowed to divide by zero. When the function has a square root, for example, square root of (x+8), we need to have (x+8) positive. That means x>or equal to -8.
So in the domain, we only take values of x that are superior or equal to -8.
To easily find the values that can be in the range, find the inverse function and do the same as what I have explained for the domain.
I hope that helps