You can use special glue, or some of them have a sticky backing (though that wears off after a while and then you need to use glue). I’ve made so many I haven’t had to use glue yet. It’s special glue.
It doesn’t hurt too bad to take them off, unless you have really hairy nipples. I recommend plucking first. When I take them off, it stretches my boobs out several inches and then it releases and I always imagine it makes a “twang” noise even though it doesn’t. And then the inside is often filled with a little pool of sweat. You have no idea how much your nipples sweat! And then your boobs are a little sticky. But all of these things are really minor. I guess unless you have super sensitive nips.