Question need some other specification, serial transmission can be done in several way, trough polling, interrupt, with specialized code or by using the library function.
To start you can try to use the printf library function, refer to the compiler manual for the microcontroller that you're using.