Nikon autofocus shows r10 and the autofcus is not working when I zoom in and seems to be making a noise
The "r10" message in the viewfinder is NOT an error code. The "r" stands for "remainder" and the "10" is the value. Together, it tells you how many more photos the camera's built in, high speed memory buffer can hold BEFORE the shutter will be stopped - so that the pictures in this memory can be transferred to the removable memory card. The process will take a few seconds or more - depending on the speed of the memory card you provided in the camera. If you pay attention to the the "r" number, while taking photos is rapid succession, after each picture - the number will decrease by one. When it reaches 0, you can no longer take additional pictures. During this time - the camera is moving the pictures to the memory card. When done, the "r" number will be high again, and the shutter will operate again.
The auto focus motor will make some noise it is turning to advance or retract the focus mechanism, and is normal. The camera requires sufficient contrast to obtain focus. Most of the time, a well lit subject will provide this. If you are zoomed in on a rather featureless subject - such as a clear or overcast sky, solid color flat wall, etc., where there is a lack of contrasting objects in the viewfinder, the camera can not detect an "edge" on any object; so it attempts to focus over the entire range of the lens to find it. If it can't, it prevents the shutter from releasing.
There is also a minimum distance that the lens will focus, too. If you are trying to zoom in on a close object, the lens may not be able to do it. In this case: either back away, zoom out - or both. If you need to get close to objects, you should consider buying "Macro" lenses. Nikon brand lenses that do this type of photography, oddly are called "Micro" lenses instead.
I hope this helps. Good luck!