What coaches value most
Coaches value consistency over just about anything else. If you play great one game and follow that up with an awful game, it creates a doubt in the coaches mind about what you are capable of, and what they can expect to get out of you. When a coach has doubts in his mind about what you are going to do out on the floor, it will negatively effect your playing time.
Consisteny takes two forms: consistency of effort, and consistency of your level of play. You have almost complete control over the first (effort), and have a great deal of control over the second (your level of play).
Don't ever let your level of effort decline. You only have a limited time out on the floor, so make the most of it by playing with passion and desire the entire time. Even if you're not having a great shooting night, or aren't touching the ball much, you can still make a big impact by playing tough defense, going after every loose ball and rebound, and running the offense at full speed.
Unlike your effort level, your level of play will vary from game to game. You may have a better shooting night one night, a better rebounding game another, and have a season-best assist total the next. There are lots of reasons your performance may vary from game to game (for example: you may play against a very good defensive team one night, and a terribly defensive team the next game).
But if you play smart, play hard, and give consistent effort, your overall performance will be solid. That is what your coach will be looking for: they can depend on you game after game to play well. Better quality play and more consistent play will translate into more playing time for you.
What you need to avoid to stay in the game
There is nothing more frustating than to be having a great game, only to have to sit on the bench because of foul trouble. You need to be out on the floor, not sitting on the bench watching the action.
Now, during the course of a game, you'll likely get called for a couple of fouls. That's normal. If you are playing tough, aggressive basketball, you'll most likley end up committing a few fouls here and there. But the key is to avoid silly fouls. Silly mistakes add up quickly, and before you know it, you're sitting on the bench next to the coach, missing out on lots of quality playing time.
Silly fouls are things like reach-in fouls on defense (you should play defense with your feet, not your hands), over the back calls while crashing the boards (go after rebounds with power and aggressiveness, but don't try to jump over a guy that has better position than you), or moving screen fouls (you need to be stationary when setting a screen). These are more mental than physical mistakes: you know better than to reach on defense or to try jumping over someone for a rebound.
Avoiding foul trouble isn't just luck. Good players do sometimes get into foul trouble, but it is not the norm for them. Good players play smart, and playing smart means avoiding silly fouls like we just talked about.
Avoid silly fouls and you'll stay in the game. You can't score, rebound, or block shots sitting on the bench.
What you need to play the whole game
If you're like me, you hate coming out of games. Real competitors want to be out on the floor from start to finish, not sitting on the bench watching the action. But here's an important thing to remember: to play the whole game (or most of it), you have to be in tip-top shape, able to play at full-speed every second you're on the floor.
Are you in good enough shape to play at 100% intensity from the opening tip to the final second of the game? Probably not. But you should be. You should be ready and able to go all out every play, from the start of the game until the very end. Make it tough on your opponent: attack them on offense, and make it very difficult for them on defense.
Now, playing every second of the game may not be realistic (coaches usually like to rest players now and then, especially if the team plays man-to-man, pressing defense). But the point is valid no matter how much (or little) you play: be in such good shape that you can play full-out every second you're on the floor.
If you aren't in good shape, your performance will suffer: you'll take bad shots, you'll miss shots you normally make, you'll make bad passes, you'll get beat on defense, you'll miss blockouts, you won't get back on defense. The list goes on an on. Tired players are not good players. If a coach sees a tired player, they'll pull them from the game.
Get yourself in tip-top shape, eat well, and get lots of rest. The better shape and condition you are in, the longer you'll be able to sustain a high level of play, and the more playing time you'll get.