What is the best practice for including and accessing classes in PHP to avoid undefined variable errors?

When including and accessing classes in PHP, it is best practice to use the `require_once` or `include_once` functions to ensure that the class file is included only once to avoid redeclaration errors. Additionally, always instantiate the class before accessing its properties or methods to prevent undefined variable errors.

// Include the class file
require_once 'YourClass.php';

// Instantiate the class
$yourClass = new YourClass();

// Access class properties or methods
$yourClass->someMethod();