I started by turning off the heater and filter, and scraping all the diatoms off of the front using an expired bank card, followed by the sides and the back, although I must admit that I did not make a particularly good job of the back. I was especially careful to not catch the sand, but I think I still may have caught one or two grains which would have scratched the glass.
Next, I drained out 5-10% of the water into a bucket, syphoning up all the diatoms I scraped from the glass. At this point, I decided to clean the filter. So I took the filter out of the aquarium, which was a bit more difficult than I would expect because of the spray bar. I pulled the filter apart and started cleaning the media in the old aquarium water which I had just drained: chlorine and chloramine will kill the nitrifying bacteria that I have been growing and feeding ammonia to. In the two months that the filter has been running for, it has become covered with sand dust, including the media and the impeller. I gently squeezed the sponge in the water until I could not see any sand left on them, then cleaned the impeller, the plastic casing and rubbed the ceramic media between my hands to remove the fine sand coating which was covering it in places. Rubbing ceramic media against itself is not harmful to the filter because the vast majority of the bacteria will be inside the media. Next, I cleaned all the soft plastic as some of it still had fungus on it. I reassembled the filter and placed it back into the aquarium.
Because my tap water is hard, I have lime scale deposits around the top of the glass, inside the aquarium. I cleaned these off with some cotton wool which I soaked in spirit vinegar and then rinsed the areas with aquarium water.
Finally, I syphoned out the remaining water down to about 10 cm from the bottom. So as to not disturb the sand, I then syphoned dechlorinated and temperature matched water back into the aquarium, finishing off with a top up to get the water level right as I do not like the sound of trickling water too much. In total, I changed 36 litres of water.
Finally, I switched the filter and heater back on, managing to spray water out of the aquarium in the process, and added the new piece of wood. The flow of the filter looked much faster, now that it had been cleaned.