There isn’t a super simple solution to that. There is an algorithm called gjk that gives the distance between objects. There’s also mpr that could possibly do that too but there’s less info online about that.
Worst case you could loop over all the points and edges of both objects and measure the distance between them. The lowest would be the distance. Just point distances could be good enough.