.htaccess remove “?page=”

I have two questions, both related: Using the example url: https://www.example.com/?page=foo.php How do I use .htaccess to write that out as: https://www.example.com/foo The second part Using the …