A referendum is a public consultation that asks the opinion of the entire population on a subject.
Depending on the law that created the referendum it could be just a consultation, but most of the times it's a legal decision that forces the government to act according to the result of the referendum.
There was a good example lately that is still causing problems, the referendum on Brexit in 2016... the government had to act following the result, even though it wasn't its choice. And the issue isn't yet totally solved because no agreement has been reached yet, and it might lead to chaos and have great consequences for the UK.