Your best option is to light the subject temporarily somehow, than use auto-focus and focus lock (or better, switch to manual focus), remove the light and take the picture.
If you can't get enough light for auto focus to work but you still get get some light on the subject than use manual focus with live view (zoom in your live view to the maximum zoom to help with focusing).
Next best option is to use the lens distance scale if it has it - just stop down a bit to increase depth of field because those scales can be a bit inaccurate (also your subject distance is probably also inaccurate because if you can just walk up to the subject with a tape measure you can also walk to the subject with a flashlight and use auto-focus)
If you can't get any light on the subject and don't have a lens with a distance scale than your next option is to focus on something else that is approximately the same distance - this tends to be very inaccurate - so stop down to increase depth of field and use a depth of field calculator to make sure you have a wide margin of error (there are DOF calculator apps for all smartphones, or you can print a DOF table from an on-line calculator if you don't have a smartphone).
And finally, if everything else fail you can use the hyperfocal distance - when you focus to the hyperfocal distance (or behind it) everything from half the focus distance all the way to infinity is in focus, any DOF calculator will tell you the distance for a given focal length and aperture
If you use the hyperfocal distance, apart from giving up on blurring the background, you will also probably have to stop down because the smaller your aperture the closer the hyperfocal distance - and if your hyperfocal distance is smaller than your subject distance you have enough margin of error to get this right in the dark using approximate distances.
Also, you want to focus a bit farther than the hyperfocal distance because if you accidentally focus even a bit nearer not everything to infinity will be in focus and you can get an out of focus subject.