A young Perth woman who was having a bad day thought things couldn't get any worse - until she was pulled over by a police officer in Joondalup on Tuesday morning because the car she was driving had a broken headlight.

But what happened next shocked her, and other social media users, after she posted about the incident on Facebook.

Heathridge woman Samantha Harvey says she was driving home from a Job Seeker interview with her dog Matilda when an officer pulled her over about the light.

Having recently been made redundant, and with ongoing money and car problems, Ms Harvey began sobbing and apologising to the officer, promising to fix the broken headlight as soon as she was paid in 10 days' time.