"I got a haircut yesterday."
For those paying attention at home, a literal translation of "my hair was cut yesterday" might be 昨日髪が切れました, which more accurately meshes with our understanding of what happening to you, the speaker. But, this sentence is 昨日 髪を切りました, literally "[someone] cut [my] hair yesterday."
So, you could technically be cutting your own hair, or someone else's, too? There's no specification regarding who's performing the action, nor to whom the hair is attached?
If you were a hairdresser, and someone asked you what you did at work yesterday, would you say 昨日髪を切りました。?
Another way to say it is "きのうかみを切ってもらいました", which literally means "I had my hair cut yesterday". In Japanese, the construction "て-form of a verb + もらう" means "to get somebody to do something", and I have the impression it's commonly used by native speakers. More examples:
自転車が壊れてしまったので、兄に直してもらった。= My bicycle was broken so my brother fixed it for me.
わからないことがある時は先輩に教えてもらいます。 = When I don’t understand something my senior will explain it to me.