Cotter pins or split pins are half round wire pins that are formed such that they can be pushed through a hole and the legs then bent to stop them sliding out. This means they can be used to lock nuts, for this you would normally have a castellated nut and the cotter pin would pass through the bolt and between the castellations on the nut.
An old but new tin of Hawkins cotter pins. A selection of 10 different sizes and 10 of each in the tin.
Hawkins Wire Products were established in 1879 in England, they now in 2020 appear to still be in business and making aluminium wire products.http://www.aluminiumwire.co.uk/
Cotter pins are usually made from half round steel wire, but they can also be made from brass, stainless steel or copper.
You can remove them by bending the pins back to straight and then pulling them out with a pair of pliers.
Cotter or split pins are often used in safety critical areas such as for securing wheel nuts and so it is really important when removing old pins to discard them and fit new ones once the work is complete.