Recently, cost, and adverse environmental impacts of wastewater treatment in oil and gas industries have been elevated. Due to several negative environmental consequences, the methods for decreasing this large amount of water production are essential. Such methods can remove or decrease application of water treatment and desalination, which cause numerous environmental consequences. Downhole water sink (DWS) production is one of the methods to control wastewater production. It produces water from the aquifer to prevent water movement to the underground oil production zone. Consequently, the application of desalination plants, and their environmental drawbacks become limited. The optimal design for DWS is important to provide an efficient process regarding technical and economic aspects. DWS modeling, sensitivity analysis, and optimization are investigated as the solutions in this work based on the simulation of a reliable published model following numerical validations. In this work, in a fair comparison, it is shown that, DWS is more beneficial than conventional production with respect to water cut and oil production rate, evidentially. The related NPV is considerably improved from 1.01E+07 [$] to 1.16E+07 [$]. In the sensitivity analysis of DWS, opening length and water drainage rate, as the effective variables, have been analyzed prior to optimization, showing high sensitivity of NPV to this variable. By analyzing the mesh resolution, it is concluded that although in the vertical direction, there was no sensitivity more the mentioned model, the NPV is sensitive to grid resolution in the radial direction. Accordingly, a coarsened model is prepared to accelerate calculation in optimization in addition the fine-grid model. Afterward, by adopting a stochastic optimization technique to DWS design, the NPV is improved from 2.17E+08 [$] to 4.67E+08 [$], and the resulted optimized variables are conformed with the sensitivity results. Moreover, the effect of anisotropy on reservoir production behavior is analyzed in DWS design. This study shows that by increasing the vertical to horizontal permeability, the water production increases and oil production decreases. Finally, to verify the optimization results, a comparison between non-optimized and optimized DWS reveals significant improvement from 6.50E+07 [$] to 4.67E+08 can be obtained.