How to use material functions to make landscape layer?

Create a new material function for each layer and then copy/paste the nodes into them from the auto-generated materials
Then create a “Make Material Attributes” node and connect the appropriate networks.
Then in your landscape material create a “Material Function Call” node for each layer you want and point them to the material functions you just created.
Connect that MFC to a break material attributes node and you will be able to drag out the networks you need for each layer.
Check out the documentation for layered materials:

When you make an instance out of the new landscape material you created using functions, the parameters from all the included material functions will be exposed so take extra care when naming parameters for each layer as identical names from multiple functions that do different things will only show up as one parameter and will all read from that value in the instance.