To ensure compliance with the IRS guidelines, it is advisable that you formally request the Tax Identification Number (TIN) from your contractor before filing the 1099 forms. For a detailed guide in requesting for TIN, kindly refer to this article: Form W-9, Request for Taxpayer Identification Number and Certification.
In the event that your contractor refuses to provide the SSN or EIN and you need to file a 1099 to meet filing requirements, I'd recommend consulting your accountant or to contact IRS Contact Support for a detailed guidance on handling filing 1099 forms for a contractor without an SSN or EIN.
If you filed your 1099-MISC or 1099-NEC forms with the IRS, you may also need to file with your state. Let me add this article as a reference: File your state 1099 forms.
You're always welcome in the Community should you have further questions printing 1099s in QuickBooks Online. We'll do our best to assist. Take care.