Custom Transform Orientations
Let's say you want to slide this cube along the surface of this other cube.
Manually rotating one cube to match the other is impractical.
So is moving it along the surface accurately.
For this, you can create a custom transform orientation.
In Edit Mode select a face as the basis of the orientation.
In the Transform Orientations menu click on the + icon.
Give your new transform orientation a name.
Or... have the Blender community do it for you.
You can align the cube's rotation to the other cube now.
By going to Object > Transform > Align to Transform Orientation.
Pressing G and then X or Y will move it along the face surface.
Bonus tip: press G and then Shift+Z to exclude the Z-axis.