Ideally you should find how you can extract the most out of your intellect and use that. There's a right way and a wrong way, but not on a collective level, only in an individual one.
I do not think that you can make a habit of producing good ideas but if you produce enough ideas you will end up producing at least a few good ones, it is only a matter of time.
Also having a good storage system let me revisit ideas that were imperfect at a later point in time when I might have the correct frame of mind or knowledge to improve on them. This mean that I end up producing more good ideas on the long run.
Finally, I try to accumulate knowledge. I found the ideas of other people to be a great source of inspiration (either because I misunderstand them at a cursory glance, leading to creation, or by building on their concepts). Furthermore, keeping files on ideas I find interesting appears to be a force multiplier to improve the quality of my output: the more tools I have and the more problems I can solve.
Nobody remembers the failed attempts because they likely never even saw them. The good shit spreads.
It's just work.
Bach wrote more music than any individual will ever hear!
And so it's like mining - some rocks, some gems, a lot of in between.
I would say being in a good mood, and being carefree - completely non-judgemental of one's own thoughts. So being in an environment were 'nothing matters'. Even going to an office, there are 100 little things we are doing to be professionally conformist. So avoiding that. Sometimes it's hard for organised people to feel comfortable with disorganisation. So trying to get in a state of mind where it doesn't matter.
Doing something that is 'not serious' can help with this. So if the project has literally no purpose this may help creatively though it can really hurt the impetus to 'get it done'.
It seems like a trope, but getting to the place of the 'inner child' is certainly real. Remember when you had zero responsibilities and didn't plan ahead even 10 minutes? Totally care free. That space is hard for a lot of people because I think we feel it will make us fully 'child like' or that we lose our 'adult' demeanour. Or will be construed by others to be 'irresponsible'.
Doing something that's closer to raw creativity. Having fun in photoshop, experimenting with filters etc. - this has nothing to do with anything but a weird lesson I learned long ago there was to just 'let go' of whatever you're trying to do, and just 'go where it takes you', i.e. to be open to whatever your subconscious or a bit of randomness is happening, as opposed to the construct you might have in your head.
In improv they have this notion of 'yes, and' - which is to say whatever the other actor says, you have to go along with. It's really amazing to see how that works, and how minds can form coherency out of that.
The more proficient one is with the tools: code, frameworks, audio eng. DAW, photoshop, words, paint, musical instrument - the less mind space they occupy and the more you can do what you want.
And of course 'just doing'. Sometimes literally putting pen to paper, trying something even if you have no clue what you are doing, is a neat place to start.
Also looking at other people's work. In design, going to Behance to see other people's work is really inspiring. It's neat to see how creative frontiers are ever expanding.
You can grind in circles for ages with any topic or medium. The trick is to find a directed approach, which means getting a little more philosophical about it and then following through on that philosophy. Exploring simple themes like those in the ancient myths and legends, metaphysical ideas, moral reasoning, and technical philosophy like "what sorts of marks I can draw that successfully indicate the thing I see." These all come together when you go to make a completely realized, coherent performance or piece of media.
Identifying, respecting and following through on the conceptual structure gets you to passable skills of craft in most every field, and it's very available with effort and an existing appreciation of the medium: just start doing deep analysis of existing work. Take notes, write about the key elements using the concepts you know. Try to reproduce those parts you don't understand. Appreciation of the whole is always the first step, because dismissing any part is likely to mislead you.
But what you ultimately want to approach through the philosophy is chaotic interaction: "What happens when I put these two things together?" "I don't know." "Well, try it and find out." And then you're doing research - your philosophical framework should be strong enough to come up with a falsifiable hypothesis: "why does this joke work or not work? Because A, B, C." This is approached intuitively at first and gradually codified as you go on. You might come out of it with a singular work, or a formula for a whole set of them. It tends to be the case that career creatives can spend their entire life exploring and iterating on a tiny set of principles, which explains style distinction.
Edit: And I should add to this, "what are good examples of this in practice?" Improv acting is one of the best because it derives its energy and reliability from having underlying structure in the form of recurring characters and improv games. If the characters know each other and are familiar with a collection of games(which act as a kind of guard rail for staying coherent, a way to haul things back to creative productivity) they can reconfigure the scene in an instant and seamlessly recover from points where it slows down, and make everything look totally believable while still being surprising. I'm a bit too much of a deep-thinker to keep up in improv, but it's a useful signpost for "how do I get in that zone?"
Reading about the exercises is interesting but unless you actually try them out they are just a curiosity. I think the muscle analogy really fits when it comes to creativity.
[0]I like "The Improv Handbook" by Tom Salinsky and Deborah Frances-White
No experience necessary, if you want to learn and play some games - you're welcome!