A barrel lock (the sort that is cylindrical and has a round metal face on the front of the door and a latch on the back) is very easy to do if you are simply replacing. Deadlocks (can't remember the correct name) are a lot more complicated unless you can get an exact match for the size of the lock and where the keyhole sits within it.
most important thing is you tell us where it is a cylinder nightlatch ("Yale" type) or a mortice deadlock ("Chubb" type) or a multipoint locking system ("plastic door" type)
Measure the distance from the edge of the door to the centre of the keyhole. It will probably by two and a half or three inches for a deadlock, or 40mm or 60mm for a nightlatch.
The makers name is the next thing. If it is a mortice lock, carefully note all the words and numbers on the brass or stainless forend. If it is a lock on an external door it ought to have a british standard stamp and year.