In a large stockpot, add the pig's head, pork shoulder, onion, celery, carrots, garlic, bay leaves, thyme, black peppercorns, salt, and cayenne pepper (if using). Pour enough water to cover all the ingredients.
Over medium-high heat, bring the mixture to a boil. Reduce the heat to low and simmer, covered, for approximately 3-4 hours or until the meat is tender and easily falls off the bone.
Once the meat is cooked, carefully remove the pig's head halves from the pot and set them aside to cool slightly. Remove the bay leaves and thyme sprigs from the stockpot.
Using a strainer or cheesecloth, strain the cooking liquid into a large mixing bowl to separate the stock from the solids.
Discard the bones, excess fat, and any undesirable parts from the pig's head. Shred the meat into small pieces using your hands or a fork.
Return the shredded meat to the strained stock in the mixing bowl. Mix well to ensure the meat is evenly distributed.
If desired, you can blend a portion of the mixture in a food processor or blender until smooth to achieve a smoother texture.
Line a loaf pan or any desired mold with plastic wrap or aluminum foil. Pour the meat mixture into the pan, pressing it down firmly to remove any air pockets.
Cover the pan with plastic wrap or aluminum foil and refrigerate overnight or until the mixture has set and become firm.
Once fully set, remove the hog's head cheese from the pan and slice it into thick or thin slices, according to your preference.