This, of course, was hinted at in Avengers: Age of Ultron, when Captain America (Chris Evans) came shockingly close to lifting Thor’s hammer, visibly triggering triggering the god’s anxiety, not to mention how Vision (Paul Bettany) revealed his worthiness minutes after his creation.
It was later confirmed that Cap had the power in him all along when he took charge of Mjölnir in the thunderous climax of Avengers: Endgame.