I'd guess most people struggle with this. It depends a lot, I'd also guess, on how much guidance you get from your advisor and whether you have a research problem already or not.
But, I'd suggest reading a lot around your topic and taking a lot of notes. Your advisor can probably give you an idea about what to read. When you take notes, try to both extract the insights, not just the facts from what you read. Make connections between the various things you read, also taking notes. Look for holes and things not yet done for potential extension, now or later.
Write this all down. But, if possible, also get feedback on your notes. That may be easy or hard, depending on your advisor and other faculty or student resources. Seminars on a topic if your department faculty have such is a good place for feed back. At least, bounce what you think are insights off of others, especially your advisor if possible. Build your understanding.
But don't avoid sleep and exercise along with hard work. Take breaks.