Mainly, we use SparkConf because we need to set a few configurations and parameters to run a Spark application on the local/cluster. In other words, SparkConf offers configurations to run a Spark application.
class pyspark.SparkConf (
  loadDefaults = True,
  _jvm = None,
  _jconf = None
)
After that it will work.
To know more about it, get your PySpark Certification today and become expert.
Thanks.