Diffraction is light's response to having something mess with its path, so diffraction occurs only when something blocks part of the wavefront. Diffraction is the phenomenon where light bends around an obstacle (this bending is not due to refraction, because the material doesn't change as refraction requires). The following equations cover the most common situations involving diffraction, including resolution.
Resolution: Resolution is the minimum angular separation between two objects such that you can tell that there are two distinct objects. Here's the equation for determining resolution:
The location of the dark fringes produced by diffraction through a single slit: Because a slit has a width larger than the wavelength, light rays from different parts of the slit interfere with each other, creating a fringe pattern. You can relatively easily locate the points where the light destructively interferes by using the following equation:
The location of the different diffraction orders from a diffraction grating: A diffraction grating has a very large number of slits spaced closely together, such that the light from each of these slits interferes with the light from the others. You can pretty easily identify where the light constructively interferes by using the following equation: