Fixing nails or screws through timber and to another timber can be troublesome, sometimes the screws work to force the piece you are trying to fix away from the piece you want to fix to. The easiest ways to avoid this happening is to try one of the following;
Drill a "small" pilot hole through the piece you are trying to fix, don't use a drill as large as the actual screw, just a little smaller is best, in doing this you allow the screw to pass through but the screw head will then do the fixing for you, this is especially helpful if you are trying to fix Oak or similar hardwood timbers.
Alternatively, get an old bar of soap and rub the threads of the screw against the soap, this acts like a lubricant and allows the thread to ease its way through the piece that you want to secure, much quicker than the 1st idea but it really depends on what timber you are trying to fix scurely.
Fixing timber to timber with traditional nails; When trying to fix one piece of timber to another it is best to use "Oval" headed nails, normally known as "Oval Brads", these nails are really useful when the nail head needs to be concealed.
The issues you may encounter are "a" getting the nail started, "b" the nail bends, "c" you make hammer marks on the timber and "d" the timber splits.
"a + b" Starting the nail;
To get the nail started and to try and stop the nail bending, place the timber being fixed on a flat surface and "start" the nails that way before offering the timber up to the area that wish to fit to.
"c" Hammer marks or nails bend;
When using a hammer to drive the nails home you should stop short of knocking the nail all the way in as you will risk marking the timber, now use a nail punch to finish driving the nails all the way home and just below the surface.
"d" Timber splits;
Last but in actual fact the 1st thing you should do is take each nail and using some form of solid object such as an old brick or similar take each nail and place the head of the nail on the brick with the nails pointed end facing vertical, now take the hammer and gently tap the end of the nail to blunt the pointed end, I know this sounds like an April Fool joke but it is an old trade trick and it will prevent the timber from splitting, it really does work.