No. That's not a good question. What if I give you the answer "47"? Would that help you?
A good question might be:
"What methods could be used to detect proximity of a wall for my robot? I am interested only in proximity in a single fixed (relative to the platform) direction. I am interested in distances between about 4cm and 10cm. All I need is an indication of a nearby object, not the distance. The walls are all painted white."
With that sort of question we might suggest either reflected IR or an ultrasonic distance sensor (and we might offer some advantages and disadvantages of both).
Let's say that we tell you the IR sensor is far simpler, but it might detect walls further away than 10cm.
And let's also say you can relax your requirements and go for an IR sensor. You might then ask:
"I'm not familiar with how to build an IR sensor. How might I build a sensor with the requirements listed above (knowing that it might detect obstacles more than 10cm away)?"
Someone might suggest that you get an IR LED and photodiode and arrange them at an angle so the photodiode only sees an illuminated area of the obstacle if it is quite close. We may suggest you use your mobile phone to view the illuminated area.
Once you have this conceptually sorted out, you might ask for a good circuit to create the required signal when a wall is in range.
We might then suggest some sort of missing pulse detector with agc or similar to allow for differing ambient light levels.
You could go away and try this and tell us that it produced a signal when there is no wall, the opposite of what you require.
We might then suggest how you can invert the signal or recommend that you change whatever you have that detect the signal to select the opposite.
We would expect you to initially clearly outline the entire problem, and provide any additional details requested. At each stage we would expect you to evaluate options you are given, doing any tests needed to determine suitability. You would also be expected to reevaluate your requirements based on your appetite for complexity or reliability, or any other factors that arise.
It's hard work to do this. You may not know what is important and what is unnecessary detail. It's probably best thank you summarise detail, but offer to expand on the details if asked (people may not want to read a long time).
You'll make mistakes, and we'll make mistakes, but keeping things as simple and as clear as possible will keep is all on topic and productive.