Close the stall door and use a drill with a Phillips-head or flathead screwdriver bit to remove the screws securing the bolt to the bar stall door.
Install the screws with the drill, holding the male part of the bolt assembly to the door. You can use the holes from your old bolt, or you can drill new holes according to the bolt's needs.
Push the bolt forward and enter it into the female part of the assembly. This lines the female and male assemblies together.
Secure the female portion of the assembly to the wall next to the door with your drill and the screws that came with the assembly.
Disconnect the male part of the bolt from the female assembly and open the stall door. Close the stall door and lock it with the bolt. Realign either part of the two assemblies as needed.