Developers on Scrum teams split their time across 3 main areas each and every Sprint and should account for that in Sprint Planning.
Building the Product Increment
During the Sprint, Developers work on Product Backlog Items that help accomplish the Sprint Goal and deliver a Product Increment. Developers on a Scrum team build the Product Increment. That is their main accountability. This involves all development activities including design, coding, testing, and deployment.
Product Backlog Refinement
During the Sprint, Developers also spend time on Product Backlog Refinement and prepping for future Sprints. If the team finds itself regularly reaching the end of the Sprint without completing what they planned and keep rolling things over to the next Sprint, then that is likely because the team is not spending enough time on Product Backlog Refinement.
Continuous Improvement
During the Sprint, Developers also spend time on continuous improvement. Scrum is not magically going to solve all the team’s problems. What Scrum will do, is put a spotlight on all organizational and team dysfunctions. And then via continuous improvement, the team slowly solves these problems. And what that means is that the team needs to dedicate time to solving these problems. Things will not magically improve unless the team invests in continuous improvements. This falls into 3 categories: working on retrospective action items, managing technical debt, and working on T-shaped skill sets.

These won’t be split up equally. It will vary based on the maturity of the team. When things first start, the Developers spend a lot more time refining the Product Backlog and working on continuous improvement initiatives. As the Product Backlog gets in good shape, Product Backlog Refinement activities decrease and Developers spend more time building the Product Increment. Note that it will never go down to zero. As things get better, Developers might spend about 10% to 15% of their time on Product Backlog Refinement to keep the Product Backlog in good shape. Developers might spend another 10% to 15% on continuous improvement. So working on the Product Increment might start at just 30% and slowly ramp up to 70% to 80% but never actually get to 100% because there will always be a need for Product Backlog Refinement and continuous improvement.

Developers need to recognize that they only have about 70% or 80% of their capacity in a Sprint to build the Product Increment and account for that in Sprint Planning.