Site members will have edit access and will be able to modify pages, while site visitors will have read-only access. So simply ensure your users who shouldn't modify pages are in the site visitors group.
If users also need to modify content elsewhere on the site, then this gets trickier. One option is to split that content to a different site. Another option is to reassess whether or not its critical to block users from editing pages, considering that we have version history to fall back on if a user messes something up.
But if it is critical to lock down specific pages, then pages do exist in the "site pages" library, and it is possible to set permissions on an individual file in this library (or any library). Though, doing so is challenging, as its always easier in SharePoint to share files out to a wider audience than to restrict a file to a narrower audience. You'll need to break permissions inheritance and change the permissions of the members group from edit to read. (you'll need to be an owner to do this). These actions can be done from the advanced permissions screen of the individual file. But again, please avoid this option if possible. Usually, people don't refer to these types of permission changes positively after a few months have passed.