How to find quaternion rotations?

I am making a space game, with spaceship orientation. I’ve researched similar games and have found a common way to do rotations with spaceships is using quaternion. I have done some research to find out what quaternions are, how they work and how to use them in Unreal Engine. Yet, it’s still complicated to me. I have used C++ to implement some extra functions:

  • Euler To Quaternion
  • Set World Rotation Quat
  • Set Relative Rotation Quat
  • Add Local Rotation Quat
  • Set Actor World Rotation Quat
  • Set Actor Relative Rotation Quat
  • Add Actor Local Rotation Quat

The system I am trying to make is to store my TargetRotation and CurrentRotation in a quat, and then slerp CurrentRotation to TargetRotation each frame, then Set Actor World Rotation (Quaternion).

When the player presses a direction on the right joystick, the TargetRotation variable should update to the new rotation. How do I update a Quaternion to show my new rotation?