Smoothly rotating an object to a specific rotation.

So basically I am trying to smoothly rotate an object to match the rotation of another object.
I have done some research and while I have found some things which sort of work I think they are more complex than I need.
I also don’t really get quaternions or eulers, so while I’ll take a script that’ll work, I would really appreciate if someone could explain a little bit about how the code works as well. However like I said I’ll be happy with anything that works with or without explaination.

“Smooth” can mean different things, so this may not give you the exact behavior that you want, but I can help you modify the code if you want something different. I will also give you a brief explanation of quaternions and euler angles in the comments, but there is not much to explain with this code other than Quaternion.Slerp takes in a starting rotation and a target rotation and returns a rotation somewhere in the middle based on the size of the third argument, which should be somewhere between 0 and 1.

public Transform otherObject;
public float speed;

void Update(){
    transform.rotation = Quaternion.Slerp(transform.rotation, otherObject.rotation, speed*Time.deltaTime);
}