How do I remove the .html suffix from the product pages?
You can just remove .html suffix from your admin panel.
Go to AdminPanel,
Stores -> Configuration -> Catalog -> Catalog
Search Engine Optimization Section,
Unset value for textfield inside Product URL Suffix
Same as you can do it for category url suffix below another field is
Catogory Url Suffix.
If you can do any text with this field like .php then its display suffix as .php in your link.
Remove var folder and run commnad
php bin/magento indexer:reindex