It's best to do this job when the car is just about out of gas. You can expect a fair amount of spillage from the lines and filter barbs once disconnected, so be aware of this and plan on doing when the fuel warning light is on or close.
Disconnect the fuel pump fuse on the main fuse panel under the hood of your BMW. On E30 cars, I couldn't figure out which fuse it was so I just pulled every 15 amp fuse, but supposedly it is fuse 9. On E36 cars it is generally fuse 9. Once you have identified and removed the fuel pump fuse, crank the car over to get any remaining fuel out of the lines as much as possible. When the car won't start at all, you've done enough.
Make sure the vehicle is properly supported ie by jackstands, ramps and chocks, or a lift. Never get under your BMW with just a floor jack or god forbid the oem trunk jack aupporting the car. On E36 BMWs, the fuel filter is located midway along the driver's side door, and in about 6-10 inches. It is obscured by a plastic cover that is held in place via two protruding tabs that affix between brake lines and the body, and one nut. Remove the nut, which is on a stud. Remove and set aside. Wiggle the plastic cover out. There was no such cover on the fuel filter on the E30 1991 318i car I also did this on.
Use a screwdriver or 6mm or similar socket to loosen the clamps on each barb of the fuel filter. Get a bucket or some other container to catch the small amount of gasoline that will come out. KEEP YOUR EYES AWAY FROM THERE and wear shop glasses if possible. I can't even imagine how much it would hurt to get gasoline in your eyes.
Let the fore and after fuel lines drain into the catch pan/bucket. The long silver cylindrical fuel filter will still have one bolt hold it in place (usually). Remove the filter from the undercarriage and quickly place in container. It will have a surprising amount of gas still in it and can make a big mess if you are not careful.
Take your new filter - preferably either OEM BMW or Bosch or Mann brand - and reassemble. Remember to slide the rubber ring over the filter and to orient the filter in the correct direction front to back. Double check to make sure all connections are properly tightened, and reinstall the fuel pump fuse. The car will crank over for a few seconds while the system fills about up with gas. The car should start right back up. Make sure nothing is leaking and you are done. The fuel filter should be done every 30,000 miles in a perfect world.