Scandinavian defense

There is a fun gambit against the Scandi. Its called the Leonhardt Gambit. The black b7 pawn becomes a long-term weakness that you can exploit, and the white bishops have a tough time developing. Also the black queen is more vulnerable as most Scandi players won't know how to position it correctly in this variation, opening it up for attack.

From what I’ve heard you need to do a good defense and try to lose the least amount of pieces while at the same time checkmating there king.

Not sure who told you it was bad. It is a bit passive, and the main line often results in the queen being kicked around for a few moves, but Black does not incur any weaknesses. This solidity makes it a tough but to crack. White has a few good options. My personal favorite is to play the early Ngf3:
White will continue by putting bishops on e2 and e3, pushing d4 and c4 and play Nc3 or Nbd2 depending on the setup Black uses, with play being focused on the queenside.
As a fan of Scandi, I don't think it is bad. Using it led me to 1500 (in my main 1st account. This is my 2nd account) for the 1st time on December last year. It is risky, though, that I haven't played anymore in Rapid games once I entered the level of 1600.
When I have to play against it, the 2nd move is always : 2. exd5. You can see in the lesson on this site which states that the 2nd move should always be : 2. exd5. The opponent provokes with d5, but we can just take it without worrying about any kinds of traps behind that move.
A knowledge in Scandi proves to be useful even when I use Caro-Kann. Quite often, my opponents chose variations that looks like exchange variation which enables me to just transpose it to Scandi in which I am more comfortable and familiar, including with white's responses.
There is a post of some games in the forum by a 1900s rated player who uses it as his favorite opening and gets impressive wins, here : https://www.chess.com/forum/view/game-showcase/scandalous-scandinavian
The Scandinavian defense is not particularly bad, but there are much better options so it really isn't worth fussing with a defense that if White plays well enough Black will be doomed to the defense for the whole game. It is true that Black can try to "complicate", but in a concrete and objective way White always has the best chances. The real reason why you can see it a lot in online games is because it is about blitz games, if it is about classical chess almost nobody dares to play this defense.
If you have a GUI and the latest version of stockfish installed, and on your computer it takes just a few seconds to get from 27 to 30 depth in a few seconds, then using stockfish is good for analyzing how to play against the Scandinavian defense against any variant. Chess engines are excellent at analyzing aggressive openings, if the game opens too early the positions hide a lot of very tactical variations and it is almost impossible to compare that with human analysis today. Something I have noticed in the forums is that players are not aware that chess engines are currently excellent at analyzing openings, specifically for open openings and even more so with aggressive ones.
Openings like the King's Gambit, Scandinavian Defense, Scottish Gambit or any similar gambit, dubious gambits with Black against 1.e4 e5 2.Nf3 among many other examples; all this is a great idea to analyze it with chess engines. It is advisable not to despair and want to learn all the possible variants because humanly this is very complicated, the good thing would be to learn new movements and review with each game. Already studying closed openings with chess engines is more complicated and it is not as effective as with other types of openings, but it is not a bad idea either; The problem is that studying opening variants with chess engines leads to so many paths leading to draws that it can be disheartening to those who don't understand that your opponents simply didn't remember all those variants (neither would you). Learn a few variants, look at the evaluation and try to understand how reliable the engine evaluation is when it says things like 0.8 or 0.9 , this can be a position won or just a draw with a relatively solid defense.
Another important thing with the fun but unnecessary mess type of openings like the Scandinavian Defense and the King's Gambit, is that the one who studies mating patterns and tactical issues will be prepared to improvise traps and attacks, in blitz maybe attack not correct but in practice effective. It is also good to study exemplary games of high-level players who manage to punish the Scandinavian defense and "refute" certain variants. Of course it is good to check with the best chess engine you have how correct or incorrect the moves were in these games (even with errors they will still be very instructive).
Personally, in classical games I have 100% victories against the Scandinavian and I remember that my opponents have played it three times; In blitz things can change because in blitz chess doesn't work in the same way, but I have interesting games with hits and misses that can help you if you want to review my games against this defense.
Remember that if you have a fairly good tactical level and you know mating patterns well enough, plus knowing certain attack patterns, you are more dangerous playing against gambits than gambits with all their complications. In blitz, gambits never cease to amaze, but if you're willing to play against these kinds of things, you won't be the only one surprised when these gambits play you, you can also surprise your opponents.
Putting this in classical chess, nobody would dare to play these things with you if they know that you are a player of a certain level, since with certain knowledge it is possible to dedicate about 10 minutes of analysis to variants that you do not remember or that you do not know, so these doubtful openings or some literally wrong ones are played particularly in blitz or perhaps rapid.
If we want, we can just offer the black to transpose the Scandi to either French or Caro-Kann defense :
- e4 d5
- d4 e6 which transposes to French defense
Or
- e4 d5
- d4 c6 which switches to Caro-Kann

If we want, we can just offer the black to transpose the Scandi to either French or Caro-Kann defense :
- e4 d5
- d4 e6 which transposes to French defense
Or
- e4 d5
- d4 c6 which switches to Caro-Kann
1. e4 d5 2. d4 is not a French nor a Caro-Kann. It is a Blackmar Deimer Gambit. Black will play 2...dxe4.
If we want, we can just offer the black to transpose the Scandi to either French or Caro-Kann defense :
- e4 d5
- d4 e6 which transposes to French defense
Or
- e4 d5
- d4 c6 which switches to Caro-Kann
1. e4 d5 2. d4 is not a French nor a Caro-Kann. It is a Blackmar Deimer Gambit. Black will play 2...dxe4.
If black responds with 2... dxe4, it won't transpose to either French nor Caro-Kann. But, if black agrees to switch to either of these traditional openings, it will be like that. But, playing white, I myself never tried to offer that transpose, always follow common lines of Scandi : 2... exd5.
As for how to play against the Scandinavian defence, first of all learn from just playing 2.exd5 Qxd5 followed by 3.Nc3 Qa5 (Qd6 or Qd8) 4.d4, if Black plays 2...Nf6 you respond with 3.Bb5 Bd7 4.Bc4 From those first movements, study the different variants that you come across, learn from your own games, from the chess engine and from games of professional players. I personally saw a Scandinavian opening book and the recommendations are objectively questionable with many variations that are not worth studying, it is best to learn from your own games and improve your variations by checking with the engine after finishing the game.
The exemplary games can help you even if they have variants that you do not intend to play, because they comply with attacking ideas that you can imitate, if there is an updated guide on how to play against this defense in a course of any online class that can help you, but I 100% recommend you to imitate up to the fourth movement as I suggested, objectively they are the best movements.

If black responds with 2... dxe4, it won't transpose to either French nor Caro-Kann. But, if black agrees to switch to either of these traditional openings, it will be like that. But, playing white, I myself never tried to offer that transpose, always follow common lines of Scandi : 2... exd5.
Sure, Black can play bad moves. But the point is White cannot rely on that. Black's best response is to take on e4 (which is why he played 1...d5 to begin with), where it is difficult for White to get compensation for the pawn (the BDG is a dubious Gambit).
If black responds with 2... dxe4, it won't transpose to either French nor Caro-Kann. But, if black agrees to switch to either of these traditional openings, it will be like that. But, playing white, I myself never tried to offer that transpose, always follow common lines of Scandi : 2... exd5.
Sure, Black can play bad moves. But the point is White cannot rely on that. Black's best response is to take on e4 (which is why he played 1...d5 to begin with), where it is difficult for White to get compensation for the pawn (the BDG is a dubious Gambit).
Btw, I recognize you from a thread which discusses about Software Eng perspective on server problem. But in that thread, I used my main, 1st account which is still active. This is my 2nd account that I created with initial purpose for training and doing things that won't affect my rating in my 1st account. Of course, I have followed the procedures for approval of this 2nd account and it has been approved.
The idea of creating 2nd account is also encouraged by a GM in his blog here : https://www.chess.com/blog/Avetik_ChessMood/raise-your-rating-by-cutting-your-losses
and is allowed according to the official source : https://support.chess.com/article/596-can-i-have-multiple-accounts
In case you don't know it and are interested, you may try, just like me and others.
I’ve been told the Scandinavian defense is bad, so how do you play against it? I’ve seen it many times and I’ve just been playing 2.f3