PhDs, internships, and other such positions are apprenticeships in scientific research.
This is a good fit for you if you are interested in how and why things work, if you like asking questions, if you want to improve how things are done, and if you are motivated to persist even without immediate results.
To start your research career, look for projects at your university, or organized programs at other universities such as Summer@EPFL. These do not require previous research experience, will let you discover whether you enjoy doing research, and you will gain useful experience for a possible future PhD application.
You are not expected to have published papers before starting a PhD, but you are expected to have research experience that you gained through internships or projects. If you’re thinking about publishing a paper to improve your chances of being accepted, know that this will only look good if your paper is at a venue where the people reading your application are publishing, or at least venues where papers they cite are published. If you have submitted a paper at such a venue but got rejected, you can still mention it if you got encouraging feedback from either reviewers or the senior author.