Searching for text is easy. Searching for files where something is missing is the more useful question when you check a set of config files.
grep -L 'Restart=' /etc/systemd/system/*.service
The capital -L prints the name of every file that has no match, and nothing else. Here that means every unit file without a Restart= line, so the services that stay down when they crash. Its partner, lowercase -l, lists the files that do match.
Add -r to walk a whole folder:
grep -rL 'X-Frame-Options' /etc/nginx/sites-enabled/
That gives you every site config that does not set that header. I like this for quick audits: a short list of files to look at, instead of scrolling through a list of matches and noticing what is absent.
Combine it with -i when the case of a setting can vary, and with -F when the text contains dots or brackets.
One thing to keep in mind is that a setting can live somewhere else. A unit file may get Restart= from a drop-in in a .d folder, and an nginx site can inherit a header from an included snippet. A file on the -L list is a reason to look closer, not proof that the setting is missing in the running config.
Further reading: GNU grep manual: general output control