Your pawn lands on b8, you reach into the box for a second white queen, and there is one queen in the set and she is already on d1. This happens to everybody eventually, usually with four minutes left. Do not improvise.
At the board
Play the pawn to the eighth rank. Then raise your hand, stop the clock, and wait for the arbiter. Do not press your clock while a pawn is still standing on b8, because the move is not finished until the new piece is on that square, and a pawn on the eighth rank is not a legal position for the game to continue from.
The arbiter will bring you a queen, or take one from a board where the game has ended. This is routine and nobody will be annoyed with you. The Laws allow a player to stop the clock in order to seek the arbiter’s assistance, and this is one of the situations they had in mind.
What you must not do is play on with something improvised and hope it is understood later. A coin, two rooks stacked, a captured pawn stood on end: none of those is a piece, and if the position has to be reconstructed after a dispute you will not enjoy the ruling.
The upside-down rook
Everybody’s first idea, and the one that costs games. Under FIDE practice an upside-down rook is a rook. It looks like a rook, it is a rook, and an arbiter can rule that you promoted to a rook and leave you playing an ending with five points where you thought you had nine. Some national federations take a softer line, but the moment you are in a FIDE-rated event you should assume the strict reading.
Turning a rook over is a fine way to mark a queen only if you have said so to your opponent and, at a tournament, to the arbiter, before the game carries on. Get agreement first, then play. The three seconds cost you nothing compared with losing the point.
At the club, and online
At a friendly game or a club night with no arbiter, the rule is the same in spirit: agree out loud with your opponent what the object represents before either of you presses the clock. Most clubs keep a bag of spare queens somewhere near the kettle, and somebody will know where it is.
Online none of it applies. A menu of four pieces appears, you click one, and the site draws as many queens as you make. The only thing worth checking is your auto-queen setting, which will one day promote to a queen in the position where a knight or a rook was the winning choice.
One last practical note. If you are in a time scramble and there is genuinely no queen within reach, remember that a rook is in your hand already, a rook still wins nearly every ending a queen wins, and two queens were never the point. Get the pawn through, get a legal piece on the square, and press the clock. Then go and look at some promotion puzzles so the next one arrives with a plan attached.