There isn't a foolproof way because people have privacy settings and can opt not to show up as being online. However, the "active now" box that often appears in the right column tends to show who is online. When you're in the Q&A, the avatars of those online have a green dot in the upper right corner as well.
Chat works independently, so people can appear as being online there, but not show up as being online on the site, or vice versa. The default setting is to show up as being online in both places when you're here, but some change it.