Please see the two images. I marked a nut and locking part. what type of nut and lock mechanism it is? and what is the tool I have to use to open it?
You need to hold the shaft (in a vise with protective jaws) and turn that nut with a "C" spanner - which looks like a C with a single protruding tooth.
A poor method is to use a drift or punch, but this always damages the nut - perhaps fine for a temporary repair...
Edit as Fred says that is a circlip, actually in internal circlip which means that the nut above needs to be removed first then that circlip will come out.