to shut, close: to move a door, gate, or other barrier into its closed position so that nothing can pass through
The verb means simply "to shut" or "to close," and most often it names the plain physical act: a door pulled to, a gate barred, a prison locked. This is how it works in the parable where the wedding door is shut once the guests are inside (Matthew 25:10), in the locked room where the disciples were hiding when the risen Jesus appeared among them (John 20:19), and in the instruction to shut your door and pray to your Father in private (Matthew 6:6).
From that concrete picture the word stretches naturally into figures of speech, all built on the same idea of closing something so that nothing can pass. To "shut the sky" is the biblical way of saying that rain is held back, as in the long drought of Elijah's day (Luke 4:25). To "shut the kingdom of heaven" against people is to bar the way in, the charge Jesus levels at the teachers of the law (Matthew 23:13). To "shut" your heart against a brother in need is to withhold compassion (1 John 3:17).
In Revelation the image becomes a statement about authority. The one who holds "the key of David" opens a door no one can shut and shuts a door no one can open (Revelation 3:7 and 3:8): the power to grant or deny access rests with him alone. The related compounds ἀποκλείω (to shut fast, to lock out) and κατακλείω (to shut up, to confine) sharpen the same act, and the ordinary Hebrew counterpart is סָגַר.