Creating plugin projects in the past is not a simple task. You need to remember a lot of steps to make it. From what I remember the steps are: Create .csproj, set .NET Framework 4.6.2, Install Microsoft.CrmSdk.CoreAssemblies, etc. You can follow this link for the detailed steps for manual creation if you want.
Then I found a very easy way to create a plugin project when I look at PowerApps CLI, got a command to help us create the plugin project without any hassle. But before we go there, you need to install the PowerApps CLI from this link. If you already installed it, to make sure you use the latest PowerApps CLI, you need to run this command:
pac install latest
To create the project, you need to run open Developer Command Prompt for Visual Studio (automatically installed when you installed visual studio to your machine). The purpose of using this command prompt is because you need to sign the assembly using snk.exe.
After you open this Developer Command Prompt, what you need to do is creating the folder to the directory that you want. Remember, the naming of the folder will be the project’s name. So make sure you follow the standard naming for it. For example, I give the folder: “D:\Code\Test.Demo.Plugins“.
In your Developer Command Prompt, you need to cd (Change Directory) to the above directory path, then run this command:
pac plugin init
Here is the result on the command prompt:
You can open the *.csproj and try to build it. Your plugin project is ready to be use!