Create ServiceMonitor in Prometheus Operator

I am new to Kubernetes. I want to create Service Monitor in Prometheus Operator. I’ve installed Prometheus Operator and Grafana. I have the running pods as shown below:
enter image description here

The documentation of Prometheus Operator provides code below to create Service Monitor.

apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
  name: prometheus
spec:
  serviceAccountName: prometheus
  serviceMonitorSelector:
    matchLabels:
      team: frontend
  resources:
    requests:
      memory: 400Mi
  enableAdminAPI: false

I know this is a yaml file, but I am confused how to run this file? In other words, where should I put this piece of code to? I am learning to create Prometheus monitors. Can I get some help?

Thanks!

Source: Docker Questions