Please make sure you have selected the SharePoint 2019 Project templates in visual studio.
If there is no valid template, try to reinstall Office Development tools like this:
Run VS2019 > Tools > Get tools and features
Uncheck Office/Sharepoint development and click Modify
Wait when installation will be completed. After that install them
using the ...