Anyone have a solution for rotation?

I need a script to rotate the player based on their input, like as a quaternion not rotate/as if they were pivoting around a point.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class rotate : MonoBehaviour
    public float rotationSpeed = 5f;
    public Transform pivotPoint; // Reference to the empty GameObject

    void Update()
        float horizontalInput = Input.GetAxis("Horizontal");
        float verticalInput = Input.GetAxis("Vertical");

        float horizontalRotation = horizontalInput * rotationSpeed * Time.deltaTime;
        float verticalRotation = verticalInput * rotationSpeed * Time.deltaTime;

        // Apply rotation to the pivot point (empty GameObject)
        pivotPoint.Rotate(Vector3.up, horizontalRotation);
        pivotPoint.Rotate(Vector3.right, verticalRotation);