if i buy an apple iphone from walmart, would i still be able to use it with at&t?

I’m looking into buying an iPhone from walmart, but my question is, will I be able to use it with my cell phone carrier. I have AT&T, do I just have to put my sim card into the iphone?