In the process I sometimes try things that don't work out, but that process often leads to getting a better idea of what does work.
Oh, I know that trial & error method very well. What you have in your mind at the start almost never looks the same once it's down on paper (or up on the computer screen), does it?
Usually my overall concept is pretty much right, but the devil is in massaging the details.
For inspiration I look to all sorts of things: walking through a hardware store or looking through a home workshop or garage, perusing magazines and books and book covers, diverse aircraft and ships and cars and trains and all manner of vehicles real and fictional, the most innocuous objects. It might be found anywhere where you see a shape or pattern in something that just happens to turn a light on in your imagination.