I'd start with a track matte created from a pre-composed solid with Ramp applied to control the opacity of a solid with Fractal Noise applied. Then separate your background, foreground, and middle ground elements and place one or more copies of your fog layer between them.
This is only one of about a thousand diffent ways to do it. It would really help if you provided a screenshot or a still from your project.
A quick Google search for Fog in After Effects or Fog in Photoshop will give you dozens of tutorials. Many will be videos.
Is this footage that's been shot or is this just graphical elements?
Does it need to be photorealistic?
Does it need to have obvious z-depth?
Is there a moving camera?
There are so many possbilities here that we are going to need a lot more info from you in order to provide good help.
Different ways to do fog - off the top of my head:
- Fractal Noise
- Cloud stock footage
- 3d Fog effect
- Multiple layers at partial opacity
- Third-party plugin (for example)
Each of these could be the right answer for you, but it will depend on your situation.
This search brings up several resources, including an entire chapter on how to do this kind of thing:
"Mark Christiansen provides tips and detailed techniques for creating and compositing fog, smoke, mist, rain, and snow in the “Climate: Air, Water, Smoke, Clouds in After Effects” chapter of After Effects Studio Techniques on the Peachpit Press website."