How to rotate a bone of a mesh in C++? (new to UE5)

I am trying to rotate a bone of a mesh in C++ using Unreal Engine 5. I have already tried using USkeletalMeshComponent and UAnimInstance to get the bone transform and update the animation, but I am facing errors like “USkeletalMeshComponent has no member SetBoneTransform”. I am seeking help to resolve this issue.