To exit it you need to look to the floor closer to the camera, where you'll see a yellow door symbol painted where you first entered. Walk up to this and press X to exit via the same path you took coming in. And that's how to get out of the garage in Luigi's Mansion 3.