This is a pretty old topic.
The answer depends on what you need, as the old AttachUnitySprite isn't always ideal.
Many of the current tools are accessible if you add the following using to the top of your script:
using Spine.Unity.Modules.AttachmentTools;
To convert a Sprite to a one-off Attachment that you can use on your Skeleton, you can use:
Sprite yourSprite;
Material materialWithSettingsYouWant;
RegionAttachment newAttachment = yourSprite.ToRegionAttachment(materialWithSettingsYouWant);
To set it on the skeleton, you can call this:
Slot slot = skeleton.FindSlot("slot you want");
slot.Attachment = newAttachment;
If any animation or code is setting the slot attachment, it will overwrite the value you set, so you either need to remove other code that touches it, remove animation keys that touch it, or use slot.Attachment = newAttachment
every frame after everything else. This was true even with the old AttachUnitySprite method.
Note that your Sprite's backing texture needs to have the correct import settings or it won't work.
https://github.com/pharan/spine-unity-docs/blob/master/img/spine-runtimes-guide/spine-unity/mixandmatch-texture-inspector-options.png