Okay. Well it kind of depends on what exactly you have been doing during that year.
Have you just been doing normal training sessions? Sparring practice? Competitions?
What's your fight count like?
How big was your opponent? How much does he weigh? How much do you weigh?
Is he a guy with lots of fighting experience?
Normal training sessions are more like workout sessions and ways to sort out your technique. If you've only been doing that for a year, then it's no wonder some random dude knocked you out. You need actual fighting experience. Someone who's been sparring for a month can easily take on someone who's only been training for a year.
Then there's also the fact that size does matter. If he's bigger than you and weighs more than you, then he's going to hit harder than you. You didn't mention what the guy looks like. No matter how much training you do, you don't jump weight divisions unless you're absolutely confident. Especially if you've only been training for a measly year.
Finally there's always the factor that you're not in the ring. You're not bound by strict rules. Elbows, kicking, strikes to the back of the head etc. All of that is allowed. So you just punching your way and dodging around isn't going to cut it. I do muay thai and learned the hard way how painful it is to get tunnel vision and only watch out for punches.
So those are possible reasons.
What can you do about it?
Well obviously you'll have to be careful about who you're picking fights with. But even more than that, train. Get 1 on 1 lessons with your coach. START SPARRING. I've seen someone who's been training for 5 years step into the ring for the first time and within the first 30 seconds of fighting he completely lost his form and tried to brawl the other guy. Didn't work out for him. So I really can't stress how important actual experience is.
You won't be able to dodge punches unless you're genuinely getting punched. There's that too. You probably do padwork, but that's nothing like the speed of an actual fist coming at you I promise you that much.
But yeah. Training training and more training. You've only been training for a year, you're still a newbie. Don't get too ahead of yourself and stay dedicated. You'll see some results real quickly if you genuinely put your heart into it.