The buntline hitch is a knot I tie regularly. It is very secure, and in modern rope it can be undone even if it has been loaded. It is very compact.
I use it to tie my spinnaker halyard to the swivel at the top of the spinnaker. Unlike a bowline, I don't have to worry about how loose I tie it, as it cinches shut, and I can hoist my spinnaker as close to the spinnaker block as I like, whereas with a bowline there's a fixed loop enforcing a minimal distance.
It's easy to remember how to tie it: effectively you are tying a clove hitch with the free end around the standing part. Now, there are two ways to do this, you can tie the clove hitch towards or away from the shackle, ring or swivel you are tying the hitch around.
If you start close to the inside and work out, you get a midshipsman hitch (and if you've read your Patrick O"Brian you may have your own ideas how reliable a midshipsman was considered in the old navies).
However, if you start away from the swivel and work towards when tying your clove hitch around the standing part, then you get a buntline hitch. As it cinches tight, it holds the "clove hitch" part tightly on the inside of the knot, making it impossible to shake it off.
To untie, you bend the knot apart, which creates a bit of freedom to work it open.
There are some other knots designed for attaching a rope to a ring or shackle, but I don't use them as often and some I can't remember reliably. May discuss them in a later post. First, a picture:

This shows the knot before pulling it tight. It should be clear how to tie it. You know you got it right, when you have the two parts going parallel around the standing part, with a diagonal crossing over them and the inner one is the one with the end sticking out.