If police officers want to investigate you or search your house to look for evidence, they may simply arrive and knock on the door. Perhaps they believe you have illegal drugs in your house, for example. They may ask to come in and talk to you or take a look around.
Whether or not there are illegal drugs in the house is irrelevant here. What you’re wondering is if you have to allow them to come inside. What are you obligated to do? Can you refuse, even if you know they wouldn’t have found anything during the search?
You generally do not have to allow them inside
In most cases, you do not have to allow them to come inside your house. Some people will go outside and talk to them, but you don’t even have to do that. You can simply instruct them through the door that you would rather not converse with them or have them come inside. Try to be polite and civil, but you don’t have to give in to these demands.
If the police cannot get consent, there are some other ways that they can sometimes enter your home. They could go to a judge and get a search warrant, for example. If they show up during an emergency, they may be able to use their discretion to enter without your consent or a warrant. But you still do not have to allow them inside if these situations do not exist. No matter how much it feels like a command when they ask to come in, they can’t give you that command without the warrant.
If you have been arrested and charged with a crime, whether or not the police legally entered your home may be relevant to your case. Make sure you know about all of your legal options.