The S&P 500 and Nasdaq ended lower on Tuesday after hitting record highs earlier in the session, with investors digesting…