Background Condom use self-efficacy is critical in preventing the spread of HIV among people living with HIV (PLHIV). Knowledge of sexually transmitted infections (STIs) is a crucial factor in promoting safer sexual behaviors. However, there is scarce data on its association with condom use self-efficacy, particularly among PLHIV. Objectives This study aims to determine the association between knowledge of STIs and other demographic and behavioral factors with condom use self-efficacy among PLHIV in public health clinics at Hulu Langat, Selangor. Methods A cross-sectional study involved PLHIV attending public health clinics in Selangor, Malaysia. Participants were recruited using convenience sampling. Eligibility criteria included being 18 years or older, able to read and comprehend the Malay language, and having not been diagnosed with psychiatric illness or learning difficulties that may impede their ability to answer the questionnaire. Data were collected from December 2023 to March 2024 through self-administered questionnaires assessing demographic characteristics, sexual practice, clinical factors, knowledge of STIs, and condom use self-efficacy. Multiple linear regressions were performed to identify factors associated with condom use self-efficacy. Results The mean score for condom use self-efficacywas 77.72 ± 12.88, and the mean score for knowledge of STIs was 30.87 ± 5.50. The higher STI knowledge score was associated with higher condom use self-efficacy (B = 0.73, p < 0.001). Other significant factors were higher household income (B = 9.27, p < 0.001), recent sexual activity within the last three months (B = -4.34, p < 0.001), engaging in receptive anal sex (B = 7.06, p < 0.001), and not using a condom during the last sexual intercourse (B = -4.43, p < 0.001) wereassociated with condom use self-efficacy. Conclusion The study confirms that good STI knowledge increases condom use self-efficacy among PLHIV, therefore highlighting the need to educate those at risk with better knowledge of STIs. It also highlights the importance of conducting interventions for those at higher risk due to lower condom use self-efficacy and exploring their barriers towards the use of condoms.