When I play normally in single player mode it is very lagging, but when I play on servers it is not lagging at all, can someone help me?
That is normal. On servers, a large part of the calculations is done by the server. You more or less only stream the picture (of course, it is a little more complex).
In the single player, your PC / laptop naturally takes over all the calculations, which puts a lot more strain on it and, if necessary, overloads it a bit. That's why it's lagging.
Possible solutions:
Only play on servers
Allocate more RAM to Minecraft (tutorials can be found by google and on YT)
Buy a more powerful computer or upgrade the existing one.