I have done contractor work for American startups (mostly YC) based in Silicon Valley for the last 7 years.
Like many others in this thread, I set up a one man company, and I invoice my client[s] every month to receive the money on a Wise (previously Transferwise) business account in USD, then every year I do take care of paying taxes in my country with the help of my accountant. I'd like to highlight that Wise is likely the best option to receive USD for EU contractors/consultant, during my first year I didn't use it and I lost something around 1.5K USD because of opaque exchange rates and fees... :facepalm:
If they are really pedantic and careful, they might ask you to fill W-8 BEN / W-8BEN-E form, however the majority of my clients didn't.