Check which piece is in front.
In the Italian Game, ...Bg4 pins White's f3 knight to the queen on d1. Put the queen in front and the knight behind, and the same line is a skewer.
Read the line from your piece outwards
Both tactics need a bishop, rook or queen aiming down a line at two enemy pieces, one behind the other. Knights and pawns can't do either, because they don't attack along lines. The difference is which enemy piece the line hits first.
Lichess's puzzle theme page describes a pin as a position where "a piece is unable to move without revealing an attack on a higher value piece". Its skewer entry is the reverse: "a high value piece being attacked, moving out the way, and allowing a lower value piece behind it to be captured or attacked, the inverse of a pin." (Lichess puzzle themes)
In a puzzle, that gives you a quick test. Trace the line from your piece and name the first enemy piece it meets. If that piece is worth less than the one behind it, you have a pin. If it's worth more, or it's the king, you have a skewer. Two equal pieces, such as rooks, fit neither Lichess definition.
What's behind the pinned piece
When the piece behind is the king, the pin is absolute and the front piece can't legally move. The Steinitz Defence of the Ruy Lopez shows it: after 1.e4 e5 2.Nf3 Nc6 3.Bb5 d6, Black's pawn move has opened the diagonal from b5 to e8, so the knight on c6 is pinned to the king. Until Black blocks with something like ...Bd7, that knight has no legal moves at all.
When the piece behind is a queen or rook, the pin is relative. Moving the front piece is legal. It just hands over whatever was behind it, unless the move does something bigger.
Légal's Trap shows what that can look like. Wikipedia gives this natural route into it: 1.e4 e5 2.Nf3 Nc6 3.Bc4 d6 4.Nc3 Bg4 5.h3 Bh5 6.Nxe5. Black's bishop is pinning the f3 knight to White's queen, and White moves the knight anyway. If Black takes the queen with 6...Bxd1, then 7.Bxf7+ Ke7 8.Nd5 is checkmate. Black's better reply is 6...Nxe5, which according to the same article still leaves White a pawn up. (Wikipedia: Légal Trap)
In that line the pinned knight was never really stuck: moving it wins at least a pawn, and mates if Black takes the queen.
Once you've found a pin
A pinned piece is a target. If you attack it again, it can't step away without exposing what's behind it. Chess Strategy Online wins a pinned knight by hitting it a second time with a bishop, and adds a second point: a pinned piece "can no longer effectively defend other pieces". (Chess Strategy Online: pins and skewers) A knight pinned to its king can't recapture on a square it appears to guard, so look at what it was protecting.
Expect your opponent to look for a way out. The same tutorial lists the escapes: give a check with the pinned piece or the piece behind it, or put another piece in the way. If you can see the escape before you commit, you can choose a version of the pin that doesn't allow it.
Before you play the skewer
A skewer can start with a check. Take a bare sketch rather than a game: Black's king on e5, Black's queen on e8, and a white rook that can reach e1. Re1+ forces the king off the e-file, and once it moves, Rxe8 takes the queen. Black has no piece that can block on the e-file or take the rook.
Real positions are messier, so look at the piece behind. If it's defended, you're trading your attacker for it. Giving up a rook for a defended queen still wins material; giving up a queen for a defended knight loses it. Also check where the king can step: a square next to the back piece may let the king defend it.
Practising the two together
If you want to drill one fixed set until these come quickly, the Woodpecker Method post on this blog explains how the cycles work.
chessReflex has Pin and Skewer as separate themes, with puzzles from the Lichess puzzle database built into the app, so they work offline. Each theme is a fixed set. A round is one full pass through it, and the next round starts once you've solved every puzzle again, which is Woodpecker-style repetition. If you're stuck, "Get a hint" gives you a nudge, "Show move" follows if you still need it, and "Restart puzzle" sets the position up again. It's in private beta on Android; you'll find it on the chessReflex home page. Doing a few from each theme in the same session means checking which piece is in front every time.
Put the idea into practice.
Explore chessReflex