Is it safe to take unisom and tramadol at the same time?

Not a good idea. The combination can increase the risk of CNS depression & psychomotor impairment. Tramadol alone should be adequate to relieve discomfort as well as allow you to sleep.