If you see a padlock icon ? next to someone's name on Mastodon, this means they've got follow requests switched on.
When you try to follow such an account, a follow request will be sent to the account owner who will have to manually approve your follow.
To cancel a follow request, press the follow button again (it will have turned into a "Cancel follow request" button when the request was made).
You can switch this feature on for your own account by going to Edit Profile > Require Follow Requests, tick the box and click "Save Changes". (To switch it off, untick and save.)
People do this to restrict who can follow them, sometimes just to weed out spammers but sometimes because they only want certain kinds of accounts following them.
If someone has specific requirements for their followers, they'll usually state them in their profile biog text. It's worth reading this before sending a follow request.