Create sign in page only those who have an account can enter

Hi how to create a block where when you sign in to the page, only those who have created an account can enter. and if not, you have to create an account first. Thank you!

note: I have made the sign up section and it works smoothly

If you have a sign up section show us where you save data and how to help you.
When user try to login you have to search in your database if the pair name-password is correct.