How do you know when you had a good workout? Sweating a lot? Burn a lot of calories? Collapsed and can't breathe afterwards?
What really determines a good workout? For you to get the most out of your workouts and not feel like you're just going through the motions and wasting time, or conversely, doing too much, it will be helpful for you to have criteria to use before starting a workout.
Relative perceived intensity
Essentially, how hard should you try? Intensity is, in large part, a function of effort. Are you just going through the motions, or are you applying the appropriate intensity? Does your workout challenge you?
Relative is important. Relative to your physical and mental state. Are you super tired, coming off illness? Then intensity should be down. Relative to your ability. Are you trying new skills? Then intensity should be down. Are you doing something you're confident with? Then intensity should be up.
Perceived. We like to use a 1-10 scale sometimes. 1 is an easy feeling and 10 is your max. Can you rate your effort and difficulty of workout on this 1-10 scale? Maybe what feels like a 5 today feels like an 8 next week. Pay attention to those feelings and adjust your workout.
Intensity. For there to be much value in a workout, there must be an appropriate amount of intensity. You have to feel challenged. You have to give effort.
What aren't great metrics to tell if you're getting a good workout? Sweating and getting your heart rate up. For example, I can sit at my desk hyperventilating, raising my heart rate and stressing myself out. But that doesn't mean I'm actually doing any work. Crude example, but hopefully you get the point. Just because your heartrate got up or you broke a good sweat doesn't mean it was a valuable workout.
Achieving a stimulus
The stimulus is what you're trying to accomplish from the workout. Are you trying to practice sprinting or long distance running? Are you trying to practice a new skill? Are you trying to lift at near-maximal loads? Each workout or training session should have an intended stimulus. And if you don't know what that stimulus should be, how do you know if you're having a good workout? Don't miss that.. you should always know what the intended stimulus is for your workout. (and remember.. sweating and getting your heart rate up are not good enough metrics)
Let's say you're going to the gym solo and hitting the machines for "Chest day". What are you trying to accomplish - a larger sized chest or just stronger muscles? What weights, reps, and sets should you be doing to achieve the correct stimulus? Well in that example, strength training and hypertrophy training would require different weights, reps and sets.
Or what about a CrossFit workout? "Fran" is a workout that should take 5 minutes or less. The stimulus is a sprint. Light to moderate weight on a barbell thruster and fast sets of relatively easy pull ups. Let's say you go do the workout "Fran" and it takes you 20 minutes and is extremely challenging. Well, you missed the stimulus. Maybe the weight was too much for you (and maybe not safe) and pullups were too challenging. At the end of the 20 minutes you feel like you got a good workout. But if you didn't achieve the sprint stimulus, did you actually improve your fitness? And, did you risk injury by doing something too challenging for you? You would've been better suited "scaling" the weight or pull up difficulty so that you could finish the workout in 5 minutes or less.
What isn't a good metric to know if you hit the stimulus? Counting how many calories you "burn." Another crude example: I can burn a lot of calories flopping around like the wacky-arm-waiving-inflatable-tube-man, but what will that do for my fitness? Not much. Focusing on burning calories in a workout is a deeply seated and outdated belief that Americans have held for too long. More calories burned, the better the workout, doesn't account for what the intended stimulus of the workout is. Distilling your quality of workouts down to how many donuts you "burn off" isn't a recipe for success.
Training with intent
It's squat day. The workout calls for a 5x5, and the heaviest set should be a new 5 rep max attempt. What would it mean to train with intent? 1) Squatting safely with the best technique you can and going thru as full of range of motion as you can. 2) And after that, lifting heavy enough where you are attempting what feels like a max for the day. How do you achieve all of that? Warming up with intent. Being in tune with your body. Practicing the best squats you have from the 1st rep to the last rep. Remembering that your weakness is your knees wanting to cave in so you need to activate your glutes a lot before squatting and think about keeping your knees out while doing your reps. That's training with intent! And if you do all of that - you had a great workout! Celebrate it!
What isn't a great metric to tell if you had a great workout?
If you achieve a PR or not. Commonly we'll judge the workout based on the result. Lifting "heavy" doesn't always mean you're going to get a new personal record. Honestly, the vast majority of training sessions you will not get a new personal record. So don't come into workouts hoping for, and being disappointed if/when, a new PR doesn't happen. That's the nature of training and personal records. They are records for a reason!