In this modern era, gaining additional income is necessary to fulfill daily needs since inflation is unavoidable. Investing in stocks can give passive income to help people deal with the increasing prices of necessities. However, selecting stocks and constructing a portfolio is the major problem in investing. This research will illustrate the stock selection method and the optimization method for optimizing the portfolio. Stock selection is carried out by clustering using Self-organizing Maps (SOM). Clustering will show the best stocks formed for a portfolio to be optimized. The best stocks that have the best performance are selected from each cluster for the portfolio. The best performance of the stock can be determined using the Sharpe Ratio. Optimization will be carried out using a Genetic Algorithm. The optimization is carried out using software R i386 3.6.1. The optimization results are then compared to the Markowitz Theory to show which method is better. The expected return on the portfolio generated using Genetic Algorithm and Markowitz Theory are 3.348458 and 3.347559975, respectively. While, the value of the Sharpe Ratio is 0.1393076 and 0.13929785, respectively. Based on the results, the best performance of the portfolio is the portfolio produced using Genetic Algorithm with the greater value of the Sharpe Ratio. Furthermore, the Genetics Algorithm optimization is more optimal than the Markowitz Theory.