Depending on the bird you have will depend on how you teach it. A parakeet is one thing, but larger birds that have a beak you can grab and play with is actually fairly easy. Its more about teaching beak pressure and what is okay, that does mean in the process you may get a few pressure bites. But we do what I call beak wrestling with birds from our sun conure who is not quite a year to my bare eye cockatoo and even Max, the blue and gold macaw.
With the sun its wrestling all around with him being so young, he is very playful and loves to wrestle and play tough. I'll grab his beak, then he'll either grab a finger with his beak or his foot. If he bites too hard, I pull my hand away and verbally tell him no and then the process just repeats over and over. My daughter started this with him from the moment he came home at about 10 weeks of age maybe, so he's always been taught he can play with his beak, but not hard.
Ivory, my bare eye girl, reacts to sounds alot, so with her I not only say no, but usually let out a bite of a yelp or ouch, enough that she lets go and she is such a sweet girl she immediately starts asking for kisses. But I also play with her beak and tell her no when she's getting too much pressure.
The big boy, I don't wrestle with him so much, I'll grab his beak and play with it but I have taught him that fingers in the beak are a no no. That's just me and my decision, others will let their macaw preen or groom fingers, Max can be iffy with other people, he came home at 25, so no matter how wonderful he is with me, there is always a worry he might go too far with another person. So, I opted for no beak on skin period. And he learned that in no time. He does still love to run up when he is on the floor and grab my toes, no clue what the bird toe fetish thing is!! But, I have taught him that he can tickle with his beak, he now will take his beak tip and kinda drag it lightly across the bottom of your foot if you are sitting with your feet propped up and he sneaks up on you.
The biggest thing teaching a bird anything is consistency and repetition. Birds are truly brilliant and they learn no and what is appropriate, but you also want to reward and praise them when they play nice or are good babies.
Good luck and I hope to hear you are having fun playing with your bird and the beak pressure is not an issue!!!