This is such a common question that I think it deserves a sticky thread or faq. I'm sure the following text could be improved, but I think it's a good start.
You need to be able to identify a few parts of the fuel system. Follow the fuel hose from the primary filter (often a Racor) to the engine. First, the hose goes to the low-pressure fuel pump (also called a lift pump). On a Yanmar this will be a mechanical pump. Then follow it to the secondary fuel filter, which is attached to the motor. From there find the fuel line that goes to the high-pressure fuel pump. So far you have traced the low-pressure fuel system. (If you are having trouble finding the high-pressure pump you can trace the metal fuel lines back from the injectors.)
If you introduce air into the low-pressure fuel system, for example, change the fuel filters, you should bleed the air from the low-pressure system before trying to start the motor. If you ignore this advice you will force air into the high-pressure system and then you have to bleed that as well. Also, when changing filters, do not fill the filter with fuel before reinstalling it.
To bleed the low-pressure system open the vent on top of the secondary filter bracket until you can see the hole in the side of the threads. Find the low-pressure fuel pump and operate the small lever on its side. Only the last ˝ inch of travel pumps the fuel. Move the lever back and forth until clear fuel comes out of the vent screw on the filter. This will take many strokes if the filters have been replaced. (Use a cup or a rag to catch the fuel coming out of the bleed screw.) When you have good clear fuel with no bubbles, close the screw. If operating the lever pumps no fuel (there is no resistance operating the lever) you may have to turn the engine over a tad (with the kill switch out). This will move the pump cam off the lever. Then find the inlet into the high-pressure pump. The hose comes from the secondary filter. Loosen the banjo bolt a number of turns, and then once again operate the lever on the fuel pump. It should only take a few strokes to get clear fuel at the high-pressure pump inlet. Then tighten the banjo bolt. The low-pressure system should not be air free.
The high-pressure system consists of the high-pressure fuel pump, the fuel lines going to the injectors, and the injectors. Normally you do not need to bleed the high-pressure system after changing filters, just the low-pressure system.
Bleeding the high-pressure system goes like this....
Bleed the low-pressure system first. Then, open the connection at each injector 1 full turn (open all of them). Turn the key on and crank the engine over until fuel spits from the loosened connectors. Do not pull out the kill switch! The engine cannot start like this so don't worry. Then firmly (these things run at 2,000 - 3,000 psi) re-tighten each injector connection. There is no hurry, the fuel cannot “leak-back” while you are doing this step. That's it - start it up! (If it doesn't start, bleed the low-pressure system again, and then the high pressure system.)