Connect with Google account

(1) From the upper-right corner, click "External tool connection."

(2) Click "Sign in with Google."

(3) The Google sign-in page will appear. Sign in with your Google account.
(4) After you see "Yahoo!広告 スクリプト wants additional access to your Google Account," click "Continue."
(5) Yahoo! JAPAN Ads Script view will appear.
  When you see the check icon in the "Status," your connection is complete.

How to find the spreadsheet ID

The spreadsheet ID appears in the spreadsheet URL (See the red part).
https://docs.google.com/spreadsheets/d/xxxxxxxxxxxxxxxx/edit#gid=0
Specify this character string as a spreadsheet ID in Yahoo! JAPAN Ads Script.

Reference: Google Sheets API Overview (Google Sheets for Developers)
https://developers.google.com/sheets/api/guides/concepts(2022-11-02)