Is there anything I can do to always have a good meditation?
It is through gratitude, the gratitude that is inside the heart, not inside the mind, that you can make your meditation excellent. Just for a fleeting second, remember that once upon a time you were the same as your friends and neighbours. Now look at the difference between you. It is like day and night. They may be rich on the material plane, but on the spiritual plane they are totally bankrupt. When you see the difference, automatically a spring of gratitude will well up inside you.
If you can have a drop of gratitude, inside that gratitude you will find a world of new creation. Once the seed has been sown, it starts germinating and grows into a plant. So when you are not getting a good meditation, the best thing is to think of what you were and what you are going to become. Once upon a time you could not even crawl; now you are running in the spiritual life. Once you see the difference, you are bound to have gratitude to the Supreme, for He is the Doer. It is He who has inspired you and acted in and through you. He has inspired you and He has given you the fruit of your action, so naturally your gratitude will come to the fore and you will be able to have a good meditation.