But I will answer this question for metric spaces.
Basically we replace the open interval with open balls .
In other words, there is a natural extension of the definition.
As we move into abstract topological spaces, we replace open balls with open sets.
I hope this very simplified outline gives you some guidance.