There wasn't a lot of active listening going on when Pabbie the troll told Elsa and her parents that she must learn to control her powers, but "fear will be your enemy." For some reason the King and Queen of Arendelle took that to mean they must lock the palace gates, reduce Elsa's contact with people, and keep her powers hidden from everyone, including her sister Anna -- all of which are the perfect circumstances to breed nothing but fear, of course.
This is the point of "How 'Frozen' Should Have Ended," an alternate ending for the Disney favorite, created by a popular YouTube channel that fixes the endings to films that could benefit from a re-write.
With "Frozen," it's pretty clear that the whole endless winter that Arendelle would eventually suffer could have been completely avoided if Elsa's parents simply embraced her powers, and just took Xavier’s School for Gifted Youngsters from the "X-Men" series. We mean, obvi.