If you use the following:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.com$
RewriteRule (.*)$ https://www.newdomain.com/$1 [R=301,L]
You shouldn’t have to redirect each old page to the new page.
What is happening with the code above is this (for example): A visitor goes to https://olddomain.com/myspecialpage.html. Since this request matches the first rewrite condition, the myspecialpage.html portion is stripped off and appended to the new domain, like this: https://www.newdomain.com/myspecialpage.html. Regardless of the page or directory requested, this code will redirect the visitor to the same location on the new site.
The only instance where you will need to provide page-specific rules is when you change the URL for a page. For example, if you had a page on the old site located at: https://olddomain.com/thisdirectory/mypage and on the new site you wanted visitors to end up at https://www.newdomain.com/thatdirectory/mypage, you would need to setup a rule that would send people from /thisdirectory/ to /thatdirectory/. If you just relied on the code at the top of the page, the user would be sent to the right domain, but the wrong directory.
So to answer your question specifically, just be sure ‘RewriteEngine On’ appears in your .htaccess file before the lines:
RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.com$
RewriteRule (.*)$ https://www.newdomain.com/$1 [R=301,L]
You don’t need to do anything else if you are just copying your WordPress site as is to a new domain.