Valid as of 10 November 2021
https://www.gov.scot/publications/coronavirus-covid-19-international-travel-quarantine/pages/red-amber-and-green-list-countries/ is the starting point. The US is a ‘non redlist country’ from the point of view of the UK.
Assuming you have been fully vaccinated, you need the US CDC card, and proof of your US address.
In advance, you should book and pay for the required Covid-19 test that is sent by post to the address in Scotland where you are going to be staying; that booking produces a reference number for the Passenger Locator Form (PLF) . You can use the CTM booking portal to book and pay £68 for an NHS COVID-19 PCR test, or you can buy a Day 2 PCR or Day 2 lateral flow test from a list of private providers.
Within 48 hours before arrival in the UK you need to complete a PLF. This includes the flight number and arrival time, and won’t let you finish the form until 48 hours before.
The UK form applies for entry to Scotland https://www.gov.uk/provide-journey-contact-details-before-travel-uk . I printed the PLF – the airline checks it, and it is checked again at the UK border.
You need to take the test you booked within 2 days of arriving in Scotland.
To return to the US from Scotland, you have to test before you leave the UK.
https://www.cdc.gov/coronavirus/2019-ncov/travelers/testing-international-air-travelers.html has the requirements. You will need to get a COVID-19 viral test (regardless of vaccination status) before you travel by air into the United States. You must show your negative result to the airline before you board your flight.
If you are fully vaccinated, you need to take a viral test no more than 3 days before the flight’s departure from a foreign country. This doesn’t have to be a PCR test. An antigen test, although not a self administered test, is sufficient. Newington Pharmacy in Edinburgh had a turn round time of 15 minutes, given an advance booking, for giving me the printed result. A picture of that result, uploaded to the airline check in process, meant I could get a printed boarding pass, and so change terminals airside in Heathrow.
I travelled in July and August 2021, when the requirements were more stringent, including 10 days of self isolating quarantine in Scotland. I haven’t tested the new regime since non US citizens have been allowed to travel to the US (this changed on 8 Nov 2021).