Will RAMPS able to control 4 stepper motors I am making a DIY 3D printer based on the prusa mini. So, I doubt is if RAMPS can only control 4 stepper motors as it has slots for 5 stepper motor slots and one will not be used in my case, if I can in what order should I connect the drivers and also ho will Marlin figure out which slot the extruder is connected? Sorry for the lack of knowledge if fit is really obvious  :|
There is no problem with using 4 motors instead of 5. The 5th slot is provided to enable use of a second extruders, but many people only have a single extruder printer and leave the 5th slot unused.

how will Marlin figure out which slot the extruder is connected

Which stepper motor is in which slot is something you can configure in the firmware. There is no way for the firmware to &quot;figure it out&quot; without help.
It is quite involved to change it in the firmware, so it is best to follow the default placement. You can easily find wiring diagrams for RAMPS (showing the default assignment of motors to slots) on various resources such as the RepRap wiki.