If you cast an illusion of a 5ft pit, the creature would need to either move around it, thinking its real, or interact with it, using up its action to determine if it was real.
What im not sure about is what if the creature interacts with say a fake illusory pit and fails the save... they...