Here are the general steps involved in replacing the head gasket on a 2.0 D-4D Avensis:
1. Disconnect the battery and drain the coolant from the engine.
2. Remove the intake manifold, exhaust manifold, and other components that obstruct access to the cylinder head.
3. Remove the camshaft, timing chain, and other components from the cylinder head.
4. Carefully remove the cylinder head bolts and lift the cylinder head off the engine block.
5. Clean the mating surfaces of the cylinder head and the engine block.
6. Install a new head gasket and position the cylinder head on the engine block.
7. Install the cylinder head bolts and tighten them to the specified torque.
8. Reinstall the camshaft, timing chain, and other components that were removed.
9. Reinstall the intake manifold, exhaust manifold, and other components that were removed.
10. Refill the coolant and connect the battery.
Note: It is important to follow the manufacturer's instructions and use the correct tools and parts when performing this repair.