Hi and welcome!
It is best to use both glue and screws in combination with wooden supports for maximum durability. When glue is used, the resulting bonds will have different strength for different types of material (MDF, plywood, MDO). For example, it is possible to use only glue to hold MDF pieces together. Though I would still use screws, because the bonds may degrade after some time.
Drill appropriate pilot holes and tighten screws until they are a bit deeper than the surface of the material. Then apply wood filler and sand to get a smooth surface.