So, using Mold Earth, can I remove the 5ft. cube of loose earth under an enemy?
In the spell description, it says
"If you target an area of loose earth, you can instantaneously excavate it..."
Now, it depends on what you want to achieve and what your DM rules. The spell specifically states "This movement doesn't have enough force to cause damage." and it also depends on your DM's definition of "loose".
So I would say, yes, you can move a 5ft cube of earth from underneath an enemy, but your DM may rule differently depending on your goal.
Yes, you could remove a 5' cube, assuming it's loose earth.
However, doing so WILL cause no physical damage to the enemy. (You could rule, the 'damage' would be to speed, additional movement, the ability check to see if enemy gets caught in the hole or not, etc) I'd say the magic is powerful enough to move the dirt, but not necessarily fast or forceful enough to cause damage...the target might end up being stuck in a hole (assuming the DM allows that) or on the wrong side of a 5' hole (if the DM rules that you couldn't remove it right from right underneath an enemy or the enemy makes an ability check to not fall in).
I'd assume that loose earth here refers to the earth not being worked (e.g. regular dirt) and not being stone or walls or something special.
One thing to note with spells like these and targets is that they are meant to target a non moving target. Which you are by targeting the ground. But if you want to catch a creature in the area of affect then I'd require you to succeed at a ranged attack since your wanting to execute the spell when a moving target is in the spot you are targeting. Otherwise the target you intend will not be in the area of affect. Still won't cause damage but I might require the creatures in the area to roll to say on their feet.