The shahadah
The shahadah says that there is no god but Allah, and that Muhammad ﷺ is the messenger of Allah. In Arabic it is: ash-hadu an la ilaha illa Allah, wa ash-hadu anna Muhammadan rasul Allah.
What matters most is that you understand it and believe it in your heart. You can say it alone, in your own place, at any time. Many people like to say it in front of Muslims at a mosque so that others can welcome and help them, but this is not a condition.
Islam welcomes everyone. The Prophet ﷺ told Amr ibn al-As that Islam wipes out what came before it (Sahih Muslim 121), so the past is forgiven for the one who accepts it sincerely. You do not need to be perfect to begin.