I think the problem was that you allowed Black's King to get far too much activity in the game. This culminated in the win of a pawn, but even then, you may have been able to draw. The losing move was the Bishop for knight exchange. It should be easily recognizable that that was a losing endgame. Instead, you should've tried to trade off Queenside pawns and try to sacrifice the Bishop for the remaining pawn and secure a draw
When on the stronger side of an endgame exchange pieces, when on the weaker side exchange pawns.
Now of course this is just a general guideline. In your games you can decide when to break it and when to follow it. Afterall, its you're game. If its a mistake then you will have learned something and if isn't then hopefully your reward will be a win or draw depending upon the situation.