If you plan on re-wrapping your cat's scratching post or making a new one then you'll need to know how to attach the rope.
Sisal rope is what's commonly used for scratching posts. Considerations for how to attach it include:
When you think of a scratching post you probably most often think of it as being made of wood. Cheaper scratching posts may actually have the rope wrapped around a tube made of cardboard or some other material. You likely wouldn't know what the underlying material is until you remove the old rope you're planning on replacing.
You may find a material underneath the rope that can't hold a nail or staple very securely. You could compensate by inserting a piece of wood into the tube and attaching your nail or staple through the surface of the tube and into the wood or simply use glue.
When making your own scratching post, you can actually wrap the rope around a number of different materials besides wood (e.g., glass, plastic, rubber, etc). In these cases you'd probably want to use glue.
When removing rope from an old scratching post you may find the rope is attached with long staples. Pliers should be able to remove those staples (needle nose pliers are probably best if you have them).
If you use nails then a hammer my be sufficient. You just want to make sure the nails don't protrude where your cat could catch its claws on the nails. If using nails you may want to only use them at the ends of the post where your cat won't be actually scratching. You could use something else to attach the rope in between the ends.
With staples you'd need a staple of sufficient strength and length and a staple gun of sufficient power. The staples I'm talking about aren't the one's used with paper but with wood. A hammer would be useful to pound the staples in more deeply so they wouldn't be exposed. There are also some staples that can be pounded in like a nail instead of having to use a stapler to do it. You may even be able to reuse the staples you pulled out if you're re-wrapping an old scratching post.
Glue is probably the best choice for securing the rope as you wrap it along the length of the post (it can also be used on the ends as well). It doesn't have to be used for every wrap but can be used to secure the rope periodically (e.g., gluing the rope to the post every so many wraps to keep it from sliding around when the scratching begins).
Very often hot glue is used for this purpose which requires a hot glue gun and glue sticks. You could also try non-toxic glue if you don't want to purchase a hot glue gun and glue sticks. Sometimes the glue (and the rope) can have a strange smell that your cat doesn't like. If so, you may have to wait for the smell to dissipate before your cat will use it.
Gorilla Dual Temp Mini Hot Glue Gun Kit with 30 Hot Glue Sticks
A rubber mallet or some similar tool (something that won't damage the rope) may be useful to bang the wraps closer together as you wrap the post. It's not absolutely necessary but can help get the rope as tight as possible as you wrap it (to avoid the rope slipping later and creating gaps).
The typical sizes for sisal rope used with a scratching post are 1/4-inch and 3/8-inch. The 1/4-inch is smaller than the 3/8-inch (think 2/8-inch vs. 3/8-inch). Because the 1/4-inch rope is smaller it's easier to bend. The fasteners used can also be smaller. The 3/8-inch rope is more durable but may require a little more effort to make sure it's tight. The fasteners may also need to be larger.
1/4-Inch by 100-Feet Twisted Sisal Rope
3/8-Inch by 100-Feet Twisted Sisal Rope
You may want to start by removing the base of the post and any top if possible. You don't have to but it might make wrapping it easier.
Secure the first wrap, bottom or top, with staples or nails making sure they're not exposed in such a way that your cat could catch a claw on them. You could also use glue instead if you prefer.
Begin wrapping the post tightly. Make sure the wraps are tight against each other. You can use a rubber mallet or something similar that won't damage the rope to gently pound the rope together.
Put a spot of glue underneath the rope at least every few wraps to keep it tight.
Cut the rope to finish up the wrapping and secure the last wrap the same way you did the first wrap.
Reattach the base and top if you need to.
You could probably get away with doing the wrapping with just the rope and glue if you don't have all the tools, staples, or nails.