Depends on the position.
Ideally a queen is good. But their are times when promoting to a queen, would cause stalemate.
As long as you have enough material to mate ( Queen, or Rook) then go or the mate. I have seen numerous posts here with people complaining they were winning, and ended up in stalemate because instead of going for the win, then get greedy and keep promoting to queens.
If you haven't already. Learn how to mate with a queen, and or rook.
So I'm still relatively new to chess, and from my understanding, you should pretty much always want to promote to either a queen or in some rare cases a knight if it would let you fork/check in an important way. However, I've been doing a lot of puzzles and also some assisted games with the computer giving suggestions, and it seems like the computer does a lot of rook promotions for some reason. I think the main time I see this happen are when they know their piece is doomed anyway so they choose rook. Is there some special reason for this? Why not just pick queen anyway regardless of whether the piece is doomed? Is there some kind of hidden score meaning or some kind of inside chess code to it? And yes I know there are also situations where promoting to a queen could be a draw, but the situations they do them aren't those.
When these situations happen in puzzles I see the puzzle has "Underpromotion" category but that completely confuses me because that category makes me think there's actually some deeper meaning/emphasis as to WHY rook was chosen, but I just can't see it knowing the situation is where the piece is doomed to die no matter what they promote to...