my iphone 7 won't sync to my mac. how can i find the passcode it asks for

my iphone 7 won't sync to my mac. how can i find the passcode it asks for
Welcome to iMore! It wants the passcode that you set up on your iPhone.
on iphoto it doesn't give me a place to place the code or on my phone.

Original thread: https://forums.imore.com/threads/my-iphone-7-wont-sync-to-my-mac-how-can-i-find-the-passcode-it-asks-for.381612/