Showing error while assigning 'Foreign key' in SQL

Reference to video lecture:- Free Online Courses | IT Training Classes with Certificate - LearnVern (MySQL foreign key) at 13:00 min

While running code :-
Alter table products add Foreign key (supplier_id) references suppliers (sup_id);
Error is showing :-
MySQL said:
#1005 - can’t create table ‘learn_vern’.‘products’ (errno: 150 “Foreign key constraint is incorrectly formed”)

Export and paste your Database code to check.
Check thoroughly if you are missing Primary key in your suppliers table