How can I fix this "NullReferenceException: Object reference not set to an instance of an object Door.PlayLockedDoorSound () (at Assets/Scripts/Door.cs:34) Door.ChangeDoorState () (at"

using UnityEngine;
using System.Collections;

public class Door : MonoBehaviour
{
	public bool open = false;
	public float doorOpenAngle = 90f;
	public float doorCloseAngle = 0f;
	public float smooth = 2f;
	public bool isLocked = false;

	public AudioClip lockdoorsound;
	private AudioSource source;

	void start()
	{

	}

	public void ChangeDoorState()
	{
		if (isLocked != true)
		{
			open = !open;
			GetComponent<AudioSource>().Play();
		}
		else
		{
			PlayLockedDoorSound();
		}
	}
	void PlayLockedDoorSound()
	{
		source.PlayOneShot(lockdoorsound);
	}
	void Update()
	{
		if (open)
		{
			Quaternion targetRotationOpen = Quaternion.Euler(0, doorOpenAngle, 0);
			transform.localRotation = Quaternion.Slerp(transform.localRotation, targetRotationOpen, smooth * Time.deltaTime);

		}
		else
		{
			Quaternion targetRotationClose = Quaternion.Euler(0, doorCloseAngle, 0);
			transform.localRotation = Quaternion.Slerp(transform.localRotation, targetRotationClose, smooth * Time.deltaTime);
		}
	}
}

[THIS IS THE LINK THAT I’VE BEEN FOLLOWED]

You’re missing the part where the AudioSource is set in the Start method(see [UNITY 5] [13.2] Beginner Tutorial: Horror-Game - Locking Doors (Homework Solution) - YouTube), currently the way this is written source.PlayOneShot(lockdoorshould) will throw a null exception because source was never set.

Change Start(all watch your methods names, they ARE case-sensitive and your start is all lower case which means it will not be called by the engine implicitly) to:

// capital S in Start not lower case.
void Start()
{
    source = GetComponent<AudioSource>();
}