There are a few ways you can do this, depending on how you want the system to behave. There are probably even more options than this, I'm sure someone with some Copilot generated responses will be along. Just a note, a lot of those responses like to recommend plugins or non-configuration code to achieve functionality. In this case, I would say that is overkill.
1) You can do a check via Dynamics workflow when the Opportunity is created, or the [Customer] field is modified. If you put in a check condition to the workflow to the effect of "If Customer (Contact) Created On contains data". If you set this to a real-time workflow, you can even stop the workflow with an error and show the message to the user letting them know they can't create an Opportunity against a contact.
2) Alternatively, instead of throwing an error you could use the workflow to automatically update the [Customer] on the Opportunity to whatever the parent Account of the chosen contact record is. In this way, you aren't preventing users from picking a contact and you still get to see the Account information.
3) Option 2 above can also be done through a Power Automate flow. After creation or update of the [Customer] field on the Opportunity, you can run the flow and have it check the table type of the Customer lookup field. If it returns 'contact', then you will want to update it to an Account record. The downside of the Power Automate approach is that you cannot run it in real-time, so the user doesn't learn at all that they should not be using contact records.
4) The last option, if absolutely necessary, is to hide the Out of Box [Customer] field and put your own lookup field to the Account table on the form for the user to populate. You can then force an Account to be chosen and use a real-time workflow to move the value from this field into the out of box [Customer] field.
This is a relatively common request from a lot of my customers, so you certainly have options. Personally, I like #1 as it can be used to reinforce training for the users and make sure they are picking correct values themselves.
If this answer helped, please consider marking as verified.