On top of the housing the filter attaches to there is a bolt. The bolt is loosened, then grab the filter and remove the bolt, otherwise the filter will just spin. Take the filter out, keeping it upright. Find a container to pour the old fuel into. On the bolt there are a few seals which normally come with the new filter, replace those. Fill the new filter up with clean diesel fuel and reinstall it just like removing the old one.
On top of this housing there is also a fuel pre-filter which needs replacement too. it's pretty easy to do. One word of warning is there is an o-ring on the pre-filter which doesn't come with the new pre-filter that I have seen yet, so be sure to order the o-ring for the pre-filter as well.