How to calculate the straight line distance between selected objects

Thank you, but I don’t know how to connect this step