This slim,compact and retractable tool has served me well over the years. It works great for picking up small nails, tacks, screws, nuts, washers and bolts that have found their way into a recess with limited access.
It is very compact with a retracted length of 4 1/2" and will extend to 16 1/4". Remember this one is for the small stuff.
For the bigger stuff and a longer reach use the search term of -
Craftsman Pocket Telescopic Magnetic Pick-Up Tool
You'll have several choices and grip ratings to chose from, options are good.