Accept all the unsound ones.
GAMBITS: ACCEPT or DECLINE?
I don't play the queens gambit because I don't know it. But I'll always decline now.
Well it's not a hard opening to learn

As a beginner? If you, in that moment in time that you face a gambit, can't see some good reasons to decline it, accept it. Most of the time you'll learn more that way, especially if you get steamrolled.
P.S. the Queen's Gambit is not a gambit. Don't let anybody tell you otherwise. It's just a poorly named opening.

depends on the gambit. as you gain experience you will know what to do against particular gambits. for some, like the Vienna gambit, you lose the game immediately if you accept. In the Danish and Goring Gambits, while accepting is not losing for black, it is best to decline with d5

There was a chess player who once said to only accept gambits if they gave up a central pawn. But anyway, if someone plays something like the England Gambit, accept it. If it is a bad gambit, accept.

There is no general answer to this. It depends.
+1
As a beginner, I recommend sticking to "opening principles" and not worry about gambits much, but sometimes your opponent "forces" you into a gambit situation. Without knowing the opening, I would usually accept the material. Some gambits are powerful and should usually be declined, but by far most are dubious and should be accepted. I would accept gambits (if you don't know the lines) and then play chess "normally." This might mean giving back your "accepted" material advantage for piece development or something similar. Most gambits typically give up a pawn for piece development, so you have to be extra careful about falling behind in development in these cases.
A must is to analyze the "gambit" in question after the game and plan accordingly for next time.
Good advice I heard someone say was to accept all gambited pieces or pawn, but only the first pawn. If the opponent tries to sacrifice a second pawn, then decline the second one. This isn't always correct, but it is correct a lot of the time and that is good enough for the beginning chess player to generally navigate
I think the best answer to a gambit is to accept it. However, if you haven't study a way to play against them, you could decline

I think the best answer to a gambit is to accept it. However, if you haven't study a way to play against them, you could decline
Yeah...I guess. There are many bad gambits though; declining them is letting them off the hook I'd accept the gambit and learn later what the best way to continue was; if it is too tough, then I might consider declining it, but I think first should be accepting it. This is especially true for lower rated chess players who blunder a lot and it isn't actually a "gambit."
I think the best answer to a gambit is to accept it. However, if you haven't study a way to play against them, you could decline
Some gambits are bad to accept...
from everything i studied while learning chess before i had to stop to focus on exams every time you accept a proper gambit (halloween, queens, kings, vienna, etc.) you are going to lose, provided they know what they are doing. this doesn't mean declining is better as some gambits have various ways to decline, some being just as bad as accepting (looking at you vienna).
so i would say take one of three routes, study the common gambits and know how to interact with them. just accept every gambit you are offered and see how it goes, changing how you accept/decline depending on how it went. or you can do what i did which is learn a black opening that doesn't interact with whites opening gambits, comes with it's own challenges but at least they have to engage me on my terms this way.
What is your opinion/recommendation to a beginner/learner for gambits, first and then? First accept all for a period of time, then decline? First decline all for a period of time, then accept? Accept in a game and decline next? Dependent on the gambit name? Please consider that our aim is to learn, not to increase ratings.
EDIT: Please inform us about your level of chess knowledge or experience in your answer. I would be grateful.