If you learn to play a musical instrument you will son realise that the only way to develop your playing ability is with regular practice.
The best way to practise is “little and often” but you should also have realistic and achievable goals.
Whatever instrument you play, it is a good idea to get into a routine of practice at the same time each day. Also, divide your music into sections, for example, if you are learning a piece on the piano learn it in four bar phrases. Also practise the hands separately, several times then play hands together.
The idea is to give your brain bite-size bits to memorise rather than playing through an entire piece which would involve a huge amount of info. to remember.
There is also muscle memory which remembers physical movements of your hands and fingers etc. which can be very useful if your mind goes blank!
If you are learning to play the guitar you could practise the chord changes then the strumming hand separately before playing both hands together.
There is a big difference between performing and practising but most us, including myself, have a tendency to practise as if we were performing - that is too fast!
I play it as I would like to hear it rather than take it apart and put it together slowly and carefully.
We all have a technical and expressive/creative approach to playing. Some people are more creative than technical, and of course the opposite is also true. If you can get the balance right you will find that the way you play can be both accurate and expressive which is important if you would like to be an excellent player on your chosen instrument.