If you want to create plugin of type widget, you have to inherit from IWidgetPlugin and implement 2 methods from this interface.
Prepare class for widget zones which you want to use.
First method to implement is GetWidgetZones(), where you have to return list of widget zones which you want to use.
In second method called GetPublicViewComponent where you have to put name of ViewComponent created for this plugin.
Let's create ViewComponent. It should inherit from ViewComponent, and you have to add method InvokeAsync which will return view.
As you can see, we declare name of ViewComponent, this name should be given in GetPublicViewComponent method.
Let's create simple View
That's it. Now rebuild and install this plugin.
To make it working we need to activate it.
Now you can see working widget on your homepage!
In the same time it is displayed on product page, beacuse we declared few widget zones.