I will add my ten pence worth.
If it is a young pup just away from the bitch and the rest of the litter, have a card board box with a good soft padding in the base by the side of your bed, put the pup into it a while BEFORE you intend to go to bed, ignor any noise, once your in bed and the pup starts to wimper whine or what ever just put your hand down to the pup, with in a few minutes they will go back to sleep, if they don't they they need to be let out to relieve themselves, no dog actually likes to crap in it's own nest, once they have been out, play with them for a few minutes, put them